bitflicker64 commented on PR #2941:
URL: 
https://github.com/apache/incubator-hugegraph/pull/2941#issuecomment-3778325840

    Pushed an update to this PR on branch `fix/consumers-latch-deadlock`.
   
   Main changes
   1) 
hugegraph-server/hugegraph-core/src/main/java/org/apache/hugegraph/util/Consumers.java
      - Start workers using `safeRun()` so `latch.countDown()` is guaranteed in 
a `finally` block even if `ContextCallable` fails before entering 
`runAndDone()`.
      - Removed `latch.countDown()` from `runAndDone()` to avoid double 
countdown and ensure exactly one countdown per worker.
      - Minor style cleanup (removed an extra blank line). Kept 
`LOG.error(...)` for worker-start failures since these are real 
startup/thread-context errors.
   
   2) Added 2 unit tests
      - File: 
hugegraph-server/hugegraph-test/src/main/java/org/apache/hugegraph/unit/util/ConsumersTest.java
      - Tests:
        - testStartProvideAwaitNormal: verifies items are consumed and 
`await()` returns normally
        - testAwaitThrowsWhenConsumerThrows: verifies `await()` surfaces 
consumer exceptions (no hang)
   
   Verification
   - mvn -pl hugegraph-server/hugegraph-core -am test  ✅ PASS locally
   
   Thanks!
   


-- 
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