vert-x3 / vertx-zookeeper

Zookeeper based cluster manager implementation
Other
73 stars 67 forks source link

Clustering SPI udpate #98

Closed tsegismont closed 4 years ago

tsegismont commented 4 years ago

Follows-up on eclipse-vertx/vert.x#3132

tsegismont commented 4 years ago

@stream-iori hi! I've started this PR to upgrade the ZK cluster manager to the latest clustering SPI.

It compiles but it is not functional: I've made the necessary API adjustement, could you please take core of the implementation changes needed?

Thank you

tsegismont commented 4 years ago

@stream-iori thanks for the update. I had no time to try, does the branch now compile? Does the test suite pass?

stream-iori commented 4 years ago

@tsegismont Compile is work, but test suit does not pass all. I will take the time to fix them.

tsegismont commented 4 years ago

Thanks for the update!

tsegismont commented 4 years ago

@stream-iori thanks for the update. I have tried on my machine and most tests are passing now. I was not sure about the failures so I built the 3.9 branch and I got failures too (some are the same, others different).

Do you have failures too?

stream-iori commented 4 years ago

@tsegismont I tested on 4.0 branch, since leaving vert.x 3.x with Zookeeper 3.4.x (I have to write these to Readme) I found some tests always failure after running several times. I will look it into.

tsegismont commented 4 years ago

Thank you

tsegismont commented 4 years ago

@stream-iori where do we stand with this PR? I tried to build the branch and still got some failures. Is there any way I can help troubleshoot the issues?

stream-iori commented 4 years ago

@stream-iori where do we stand with this PR? I tried to build the branch and still got some failures. Is there any way I can help troubleshoot the issues?

Can you tell me which cases failed? Does these cases same?

tsegismont commented 4 years ago

@stream-iori no they are not the same. Here's what I have:

Failed tests: 
  ZKClusteredEventbusTest>AsyncTestBase.lambda$onSuccess$2:650->AsyncTestBase.fail:268 No handlers for address some-address1
Tests in error: 
  ZKClusteredEventbusTest>ClusteredEventBusTest.sendNoContext:317->AsyncTestBase.await:121->await:47->AsyncTestBase.await:133 » IllegalState
  ZKClusteredEventbusTest>ClusteredEventBusTest.testDefaultDecoderSendAsymmetric:122->ClusteredEventBusTestBase.testSend:71->AsyncTestBase.await:121->await:47->AsyncTestBase.await:133 » IllegalState
  ZKClusteredEventbusTest>ClusteredEventBusTest.testDefaultDecoderSendSymetric:143->ClusteredEventBusTestBase.testSend:71->AsyncTestBase.await:121->await:47->AsyncTestBase.await:133 » IllegalState
  ZKClusteredEventbusTest>ClusteredEventBusTestBase.testMessageBodyInterceptor:205->AsyncTestBase.await:121->await:47->AsyncTestBase.await:133 » IllegalState
  ZKClusteredEventbusTest>EventBusTestBase.testPublishLong:240->EventBusTestBase.testPublish:477->ClusteredEventBusTestBase.testPublish:183->AsyncTestBase.await:121->await:47->AsyncTestBase.await:133 » IllegalState
  ZKClusteredEventbusTest>EventBusTestBase.testPublishString:66->EventBusTestBase.testPublish:477->ClusteredEventBusTestBase.testPublish:183->AsyncTestBase.await:121->await:47->AsyncTestBase.await:133 » IllegalState
  ZKClusteredEventbusTest>EventBusTestBase.testSendFloat:200->EventBusTestBase.testSend:461->ClusteredEventBusTestBase.testSend:76->ClusteredEventBusTestBase.testSend:71->AsyncTestBase.await:121->await:47->AsyncTestBase.await:133 » IllegalState
  ZKClusteredEventbusTest>ClusteredEventBusTest.testSendWriteHandler:397->AsyncTestBase.await:121->await:47->AsyncTestBase.await:133 » IllegalState

Tests run: 264, Failures: 1, Errors: 8, Skipped: 4

And in surefire reports:

-------------------------------------------------------------------------------
Test set: io.vertx.core.eventbus.ZKClusteredEventbusTest
-------------------------------------------------------------------------------
Tests run: 81, Failures: 1, Errors: 8, Skipped: 0, Time elapsed: 274.505 sec <<< FAILURE! - in io.vertx.core.eventbus.ZKClusteredEventbusTest
testSendWriteHandler(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 30.356 sec  <<< ERROR!
java.lang.IllegalStateException: Timed out in waiting for test complete
    at io.vertx.test.core.AsyncTestBase.await(AsyncTestBase.java:133)
    at io.vertx.core.eventbus.ZKClusteredEventbusTest.await(ZKClusteredEventbusTest.java:47)

testDefaultDecoderSendAsymmetric(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 30.302 sec  <<< ERROR!
java.lang.IllegalStateException: Timed out in waiting for test complete
    at io.vertx.test.core.AsyncTestBase.await(AsyncTestBase.java:133)
    at io.vertx.core.eventbus.ZKClusteredEventbusTest.await(ZKClusteredEventbusTest.java:47)

testDefaultDecoderSendSymetric(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 30.183 sec  <<< ERROR!
java.lang.IllegalStateException: Timed out in waiting for test complete
    at io.vertx.test.core.AsyncTestBase.await(AsyncTestBase.java:133)
    at io.vertx.core.eventbus.ZKClusteredEventbusTest.await(ZKClusteredEventbusTest.java:47)

sendNoContext(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 30.216 sec  <<< ERROR!
java.lang.IllegalStateException: Timed out in waiting for test complete
    at io.vertx.test.core.AsyncTestBase.await(AsyncTestBase.java:133)
    at io.vertx.core.eventbus.ZKClusteredEventbusTest.await(ZKClusteredEventbusTest.java:47)

testMessageBodyInterceptor(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 30.342 sec  <<< ERROR!
java.lang.IllegalStateException: Timed out in waiting for test complete
    at io.vertx.test.core.AsyncTestBase.await(AsyncTestBase.java:133)
    at io.vertx.core.eventbus.ZKClusteredEventbusTest.await(ZKClusteredEventbusTest.java:47)

testReplyBooleanFalse(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 0.33 sec  <<< FAILURE!
java.lang.AssertionError: No handlers for address some-address1
    at org.junit.Assert.fail(Assert.java:88)
    at io.vertx.test.core.AsyncTestBase.fail(AsyncTestBase.java:268)
    at io.vertx.test.core.AsyncTestBase.lambda$onSuccess$2(AsyncTestBase.java:650)
    at io.vertx.core.impl.future.FutureImpl$3.onFailure(FutureImpl.java:129)
    at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:78)
    at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:199)
    at io.vertx.core.impl.future.PromiseImpl.tryFail(PromiseImpl.java:23)
    at io.vertx.core.eventbus.impl.ReplyHandler.fail(ReplyHandler.java:63)
    at io.vertx.core.eventbus.impl.OutboundDeliveryContext.written(OutboundDeliveryContext.java:78)
    at io.vertx.core.eventbus.impl.EventBusImpl.sendLocally(EventBusImpl.java:322)
    at io.vertx.core.eventbus.impl.EventBusImpl.sendOrPub(EventBusImpl.java:308)
    at io.vertx.core.eventbus.impl.clustered.ClusteredEventBus.sendToNode(ClusteredEventBus.java:271)
    at io.vertx.core.eventbus.impl.clustered.Serializer.lambda$queue$1(Serializer.java:79)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:125)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:61)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:180)
    at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
    at io.vertx.core.eventbus.impl.clustered.Serializer$SerializedTask.handle(Serializer.java:166)
    at io.vertx.core.eventbus.impl.clustered.Serializer$SerializedTask.handle(Serializer.java:138)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:125)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:61)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:180)
    at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
    at io.vertx.core.Promise.complete(Promise.java:66)
    at io.vertx.core.spi.cluster.impl.DefaultNodeSelector.lambda$selectForSend$0(DefaultNodeSelector.java:42)
    at io.vertx.core.spi.cluster.impl.selector.Selectors.lambda$withSelector$1(Selectors.java:50)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:125)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:61)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:180)
    at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
    at io.vertx.core.Promise.complete(Promise.java:66)
    at io.vertx.core.spi.cluster.impl.selector.Selectors.dataReceived(Selectors.java:86)
    at io.vertx.core.spi.cluster.impl.selector.Selectors.lambda$initialize$2(Selectors.java:65)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:125)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:61)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:180)
    at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
    at io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49)
    at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:53)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)

testPublishLong(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 30.387 sec  <<< ERROR!
java.lang.IllegalStateException: Timed out in waiting for test complete
    at io.vertx.test.core.AsyncTestBase.await(AsyncTestBase.java:133)
    at io.vertx.core.eventbus.ZKClusteredEventbusTest.await(ZKClusteredEventbusTest.java:47)

testPublishString(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 30.406 sec  <<< ERROR!
java.lang.IllegalStateException: Timed out in waiting for test complete
    at io.vertx.test.core.AsyncTestBase.await(AsyncTestBase.java:133)
    at io.vertx.core.eventbus.ZKClusteredEventbusTest.await(ZKClusteredEventbusTest.java:47)

testSendFloat(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 30.246 sec  <<< ERROR!
java.lang.IllegalStateException: Timed out in waiting for test complete
    at io.vertx.test.core.AsyncTestBase.await(AsyncTestBase.java:133)
    at io.vertx.core.eventbus.ZKClusteredEventbusTest.await(ZKClusteredEventbusTest.java:47)
stream-iori commented 4 years ago

Hi tsegismont I try to fix failed test, can you try on your local again.

tsegismont commented 4 years ago

@stream-iori the last commits fixed most but not all of the tests. I got

Results :

Failed tests: 
  ZKClusteredEventbusTest>AsyncTestBase.lambda$onSuccess$2:650->AsyncTestBase.fail:268 No handlers for address some-address1
Tests in error: 
  ZKClusteredEventbusTest>ClusteredEventBusTest.sendNoContext:317->AsyncTestBase.await:121->await:44->AsyncTestBase.await:133 » IllegalState
  ZKClusteredEventbusTest>EventBusTestBase.testSendBooleanFalse:76->EventBusTestBase.testSend:461->ClusteredEventBusTestBase.testSend:76->ClusteredEventBusTestBase.testSend:71->AsyncTestBase.await:121->await:44->AsyncTestBase.await:133 » IllegalState

Tests run: 264, Failures: 1, Errors: 2, Skipped: 4
-------------------------------------------------------------------------------
Test set: io.vertx.core.eventbus.ZKClusteredEventbusTest
-------------------------------------------------------------------------------
Tests run: 81, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 73.347 sec <<< FAILURE! - in io.vertx.core.eventbus.ZKClusteredEventbusTest
sendNoContext(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 10.498 sec  <<< ERROR!
java.lang.IllegalStateException: Timed out in waiting for test complete
    at io.vertx.test.core.AsyncTestBase.await(AsyncTestBase.java:133)
    at io.vertx.core.eventbus.ZKClusteredEventbusTest.await(ZKClusteredEventbusTest.java:44)

testReplyBooleanFalse(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 0.5 sec  <<< FAILURE!
java.lang.AssertionError: No handlers for address some-address1
    at org.junit.Assert.fail(Assert.java:88)
    at io.vertx.test.core.AsyncTestBase.fail(AsyncTestBase.java:268)
    at io.vertx.test.core.AsyncTestBase.lambda$onSuccess$2(AsyncTestBase.java:650)
    at io.vertx.core.impl.future.FutureImpl$3.onFailure(FutureImpl.java:129)
    at io.vertx.core.impl.future.FutureBase.emitFailure(FutureBase.java:78)
    at io.vertx.core.impl.future.FutureImpl.tryFail(FutureImpl.java:199)
    at io.vertx.core.impl.future.PromiseImpl.tryFail(PromiseImpl.java:23)
    at io.vertx.core.eventbus.impl.ReplyHandler.fail(ReplyHandler.java:63)
    at io.vertx.core.eventbus.impl.OutboundDeliveryContext.written(OutboundDeliveryContext.java:78)
    at io.vertx.core.eventbus.impl.EventBusImpl.sendLocally(EventBusImpl.java:322)
    at io.vertx.core.eventbus.impl.EventBusImpl.sendOrPub(EventBusImpl.java:308)
    at io.vertx.core.eventbus.impl.clustered.ClusteredEventBus.sendToNode(ClusteredEventBus.java:273)
    at io.vertx.core.eventbus.impl.clustered.Serializer.lambda$queue$1(Serializer.java:79)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:125)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:61)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:180)
    at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
    at io.vertx.core.eventbus.impl.clustered.Serializer$SerializedTask.handle(Serializer.java:166)
    at io.vertx.core.eventbus.impl.clustered.Serializer$SerializedTask.handle(Serializer.java:138)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:125)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:61)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:180)
    at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
    at io.vertx.core.Promise.complete(Promise.java:66)
    at io.vertx.core.spi.cluster.impl.DefaultNodeSelector.lambda$selectForSend$0(DefaultNodeSelector.java:42)
    at io.vertx.core.spi.cluster.impl.selector.Selectors.lambda$withSelector$1(Selectors.java:50)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:125)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:61)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:180)
    at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
    at io.vertx.core.Promise.complete(Promise.java:66)
    at io.vertx.core.spi.cluster.impl.selector.Selectors.dataReceived(Selectors.java:86)
    at io.vertx.core.spi.cluster.impl.selector.Selectors.lambda$initialize$2(Selectors.java:65)
    at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:125)
    at io.vertx.core.impl.future.FutureBase.emitSuccess(FutureBase.java:61)
    at io.vertx.core.impl.future.FutureImpl.tryComplete(FutureImpl.java:180)
    at io.vertx.core.impl.future.PromiseImpl.tryComplete(PromiseImpl.java:23)
    at io.vertx.core.impl.future.PromiseImpl.onSuccess(PromiseImpl.java:49)
    at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:53)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.lang.Thread.run(Thread.java:748)

testSendBooleanFalse(io.vertx.core.eventbus.ZKClusteredEventbusTest)  Time elapsed: 10.505 sec  <<< ERROR!
java.lang.IllegalStateException: Timed out in waiting for test complete
    at io.vertx.test.core.AsyncTestBase.await(AsyncTestBase.java:133)
    at io.vertx.core.eventbus.ZKClusteredEventbusTest.await(ZKClusteredEventbusTest.java:44)
stream-iori commented 4 years ago

Hi tsegismont Can you try again with latest commit? Please run several times if some test failed, and let me know. Thanks

tsegismont commented 4 years ago

@stream-iori I have tried and I get some a couple failures but not always the same. This is not ideal but not different from what happened with Vert.x 3.

So I think we are ready to merge. Can you please rebase the PR?

tsegismont commented 4 years ago

Yes please go ahead!