You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2024/01/11 21:48:56 UTC

[PR] Fix race condition in LedgerHandle in drainPendingAddsAndAdjustLength & sendAddSuccessCallbacks [bookkeeper]

lhotari opened a new pull request, #4175:
URL: https://github.com/apache/bookkeeper/pull/4175

   ### Motivation
   
   There's a race condition in LedgerHandle between drainPendingAddsAndAdjustLength & sendAddSuccessCallbacks method calls. The methods could get called simultaneously which would cause inconsistency. 
   The changingEnsemble field has a thread safety issue and the changes might not be visible to the reading thread.
   
   ### Changes
   
   - use `synchronized (pendingAddOps)` as the object monitor for serializing drainPendingAddsAndAdjustLength & sendAddSuccessCallbacks method calls.
   - make changingEnsemble field volatile
   - remove the too strict rule for pendingAddsSequenceHead which breaks things after failures
   
   ### Additional Context
   
   - this is an alternative fix for https://github.com/apache/pulsar/issues/21860 
   - the other fix is #4171


-- 
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: commits-unsubscribe@bookkeeper.apache.org

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


Re: [PR] Fix race condition in LedgerHandle in drainPendingAddsAndAdjustLength & sendAddSuccessCallbacks [bookkeeper]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #4175:
URL: https://github.com/apache/bookkeeper/pull/4175#issuecomment-1909725231

   Closing in favor of the original PR #4171.


-- 
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: commits-unsubscribe@bookkeeper.apache.org

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


Re: [PR] Fix race condition in LedgerHandle in drainPendingAddsAndAdjustLength & sendAddSuccessCallbacks [bookkeeper]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari closed pull request #4175: Fix race condition in LedgerHandle in drainPendingAddsAndAdjustLength & sendAddSuccessCallbacks
URL: https://github.com/apache/bookkeeper/pull/4175


-- 
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: commits-unsubscribe@bookkeeper.apache.org

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