You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "mridulpathak (via GitHub)" <gi...@apache.org> on 2026/09/14 08:45:34 UTC

[PR] Fixed: Timing-dependent deadlock-retry test in service engine (OFBIZ-13585) [ofbiz-framework]

mridulpathak opened a new pull request, #1985:
URL: https://github.com/apache/ofbiz-framework/pull/1985

   testServiceDeadLockRetryThreadA/ThreadB relied on a fixed Thread.sleep(100) to force two concurrent threads into a circular-wait deadlock, which is inherently timing-dependent, and a database version change shifted internal timings enough that the two threads no longer reliably collided, causing service-dead-lock-retry-assert-data to fail intermittently.
   
   Replaced the sleep with two CountDownLatch(1) instances, one per thread: each thread signals its own latch once it holds its lock, then waits on the other thread's latch before attempting the second lock, guaranteeing the circular wait deterministically. A latch is used rather than a barrier-style rendezvous because the service engine's own deadlock-retry loop retries only the losing thread's service call in isolation after a real deadlock, not both threads together, and a primitive requiring all parties to rendezvous on every call would block a retried thread waiting on a partner that already moved on and will not synchronize again; a latch already at zero returns immediately, so a retried thread proceeds without waiting for a rendezvous that will never happen.
   
   Verified with 20 repeated runs of the service component test suite.


-- 
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: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fixed: Timing-dependent deadlock-retry test in service engine (OFBIZ-13585) [ofbiz-framework]

Posted by "mridulpathak (via GitHub)" <gi...@apache.org>.
mridulpathak merged PR #1985:
URL: https://github.com/apache/ofbiz-framework/pull/1985


-- 
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: notifications-unsubscribe@ofbiz.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org