Siyao Meng created HDDS-17209:
---------------------------------

             Summary: Intermittent failure in 
TestOMBootstrap#testBootstrapFollower
                 Key: HDDS-17209
                 URL: https://issues.apache.org/jira/browse/HDDS-17209
             Project: Apache Ozone
          Issue Type: Sub-task
          Components: test
            Reporter: Siyao Meng
            Assignee: Siyao Meng


{code}
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 44.33 s 
<<< FAILURE! -- in org.apache.hadoop.ozone.om.TestOMBootstrap
[ERROR] org.apache.hadoop.ozone.om.TestOMBootstrap.testBootstrapFollower()[2] 
-- Time elapsed: 44.29 s <<< ERROR!
java.util.concurrent.TimeoutException:
Timed out waiting for condition. Thread diagnostics:
Timestamp: 2026-10-21 04:24:31,393
...
        at 
org.apache.hadoop.ozone.om.TestOMBootstrap.assertLogCapture(TestOMBootstrap.java:201)
        at 
org.apache.hadoop.ozone.om.TestOMBootstrap.testBootstrapFollower(TestOMBootstrap.java:168)
{code}

The follower did log the expected line ({{2026-10-21 04:24:01,589 ... 
om.OzoneManager (OzoneManager.java:installCheckpoint(4892)) - Install 
Checkpoint is finished with Term: 1 and Index: 64}}), 30 seconds before the 
wait timed out, but the {{LogCapturer}} never received it.

h3. Root cause

{{Log4j1Capturer}} reuses the layout instance of the root {{stdout}} appender 
for its own {{WriterAppender}}. Log4j 1 {{PatternLayout}} is not thread-safe: 
{{format()}} resets and fills a single shared {{StringBuffer}}, relying on the 
owning appender's lock. With two appenders sharing one layout, a thread logging 
through the capturer and another thread logging through {{stdout}} format into 
the same buffer concurrently, so the captured text can be replaced by, or mixed 
with, another event. The same run shows this on the console as two events 
garbled into one line ({{[omNode-3-SstFilteringService#0] 2026-10-21 
04:23:46,625 [omNode-3-InstallSnapshotThread] INFOINFO ...}}). This affects 
every test that uses {{LogCapturer.captureLogs(...)}} while other threads are 
logging.

h3. Fix

Give each {{Log4j1Capturer}} its own {{PatternLayout}} with the same conversion 
pattern instead of sharing the default appender's instance.

- https://github.com/apache/ozone/actions/runs/39536954941/job/119025384824



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to