yandrey321 opened a new pull request, #11497:
URL: https://github.com/apache/ozone/pull/11497

   ## What changes were proposed in this pull request?
   
   `TestOMDirectoriesPurgeRequestAndResponse#testBucketLockWithPurgeDirectory` 
intermittently fails after 30s with
   `TimeoutException: Timed out waiting for condition`, thrown from the test's 
own `GenericTestUtils.waitFor` gate in
   the spied `acquireWriteLocks`.
   
   The test runs two directory purge requests concurrently with opposite bucket 
orders. A gate keyed on thread id lets
   a thread take a second bucket lock only after both threads have taken their 
first one. This forces the interleaving
   that deadlocked before HDDS-13729. The two requests were started with 
`CompletableFuture.runAsync(...)` on the
   ForkJoin common pool, which does not guarantee two distinct threads. If the 
first request finished before the second
   was picked up, the same worker ran the second one. Its thread id was already 
recorded and the set size stayed at 1,
   so the gate waited out the full 30s.
   
   The fix runs both requests on a dedicated 2-thread executor, so each request 
gets its own thread. The gate is
   unchanged and still guards against the HDDS-13729 lock-ordering deadlock. 
This is a test-only change.
   
   Generated-by: Claude Code (Claude Opus 5.5)
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16747
   
   ## How was this patch tested?
   
   - Confirmed the root cause: with a single-thread executor, the test fails 
the same way as the Jira
     (`TimeoutException` after ~32s).
   - With the fix: `TestOMDirectoriesPurgeRequestAndResponse` 13/13 pass, and 
the method passed 10/10 consecutive runs
     (~2.2s each).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to