graysonzeng commented on PR #4171: URL: https://github.com/apache/bookkeeper/pull/4171#issuecomment-1884618822
> > After a deep investigation, we found the cause of the error。The root cause due to `sendAddSuccessCallbacks` may be multiple called at the same time. One is that `unsetSuccessAndSendWriteRequest` is called by the BookKeeperClientWorker-OrderedExecutor thread, and the other is `writeComplete`in pulsar-io thread. We should prevent sendAddSuccessCallbacks from being called again before it completes. > > It looks like all calls happen under the same object monitor lock (synchronized for PendingAddOp), therefore it seems that concurrent calls are already prevented. @graysonzeng Could you please check if this is the case? At first I was thinking the same thing as you, it didn't seem like it should be happening. But in fact, these two threads can call two different PendingAddOp instances, and these two instances have the same LedgerHandle instance attribute. Synchronized for PendingAddOp does not block the same LedgerHandle `sendAddSuccessCallbacks` method of the instance is called, the `sendAddSuccessCallbacks` concurrent calls are not prevented. -- 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]
