shunping opened a new pull request, #36163:
URL: https://github.com/apache/beam/pull/36163

   In rare cases, a runner bug can cause the `em.pendingElements` waitgroup 
counter to drop below zero, triggering a panic.
   
   The current code has two locations where this can occur. A mutex is locked, 
and then em.addPending is called. If em.addPending panics, the subsequent 
unlock call is never reached, causing a deadlock.
   
   This PR resolves the issue by deferring the mutex unlock within an anonymous 
function. This guarantees that the lock is released even if a panic occurs, 
preventing the deadlock.
   
    


-- 
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: github-unsubscr...@beam.apache.org

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

Reply via email to