Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mdc-utils: Make LoggerStringWriter thread friendly #2771

Commits on Dec 6, 2023

  1. mdc-utils: Make LoggerStringWriter thread friendly

    Motivation:
    
    We have seen some flakyness in HttpMessageDiscardWatchdogServiceFilterTest
    that may be related to thread safety for the test log appender.
    Specifically,
    - The sink, a StringWriter, is globally shared so it can be reset by
      concurrently running tests.
    - The underlying StringWriter itself isn't thread safe and it's possible
      for it to be concurrent written to and read from.
    
    Modifications:
    
    - Make a new (thread safe) StringWriter for each thread. Based on the
      usage pattern for the LoggerStringWriter methods this should have the
      effect of having a unique writer per test.
    - Make a thread-safe proxy for the StringWriter so it's safe to write
      and read from concurrently.
    bryce-anderson committed Dec 6, 2023
    Configuration menu
    Copy the full SHA
    b20368c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0b7c5c2 View commit details
    Browse the repository at this point in the history