[GitHub] [pulsar] merlimat commented on pull request #10583: Synchronize OpAddEntry.safeRun() to prevent race on updating lastConfirmedEntry

2021-05-13 Thread GitBox
merlimat commented on pull request #10583: URL: https://github.com/apache/pulsar/pull/10583#issuecomment-840944024 > As I have mentioned earlier, if two threads are both reading and writing to a shared variable, then using the volatile keyword for that is not enough. You need to use a

[GitHub] [pulsar] merlimat commented on pull request #10583: Synchronize OpAddEntry.safeRun() to prevent race on updating lastConfirmedEntry

2021-05-13 Thread GitBox
merlimat commented on pull request #10583: URL: https://github.com/apache/pulsar/pull/10583#issuecomment-840916995 > Since we don't have a mutex while updating lastConfirmedEntry, it looks like that could create a concurrency issue if another thread races on the update. Since the