merlimat opened a new pull request #1548: Fixed race condition intruduced managed ledger addEntry introduced in #1521 URL: https://github.com/apache/incubator-pulsar/pull/1548 ### Motivation The change in #1521 introduced a race between multiple writers since the enqueing and sending operation were split between 2 threads. Fixing here by ensuring a single thread does both operation in same order. This problem was surfacing in tests failing with this error: ``` 21:12:17.989 [bookkeeper-ml-workers-OrderedExecutor-13-0:org.apache.bookkeeper.common.util.SafeRunnable@38] ERROR org.apache.bookkeeper.common.util.SafeRunnable - Unexpected throwable caught java.lang.IllegalArgumentException: null at com.google.common.base.Preconditions.checkArgument(Preconditions.java:108) ~[guava-20.0.jar:?] at org.apache.bookkeeper.mledger.impl.OpAddEntry.safeRun(OpAddEntry.java:142) ~[classes/:?] at org.apache.bookkeeper.common.util.SafeRunnable.run(SafeRunnable.java:36) [bookkeeper-server-shaded-4.7.0-SNAPSHOT.jar:4.7.0-SNAPSHOT] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_121] at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.21.Final.jar:4.1.21.Final] at java.lang.Thread.run(Thread.java:745) [?:1.8.0_121] ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services