You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by GitBox <gi...@apache.org> on 2021/11/04 22:54:50 UTC
[GitHub] [curator] scott-kirk opened a new pull request #400: [CURATOR-561] Reset connection after repeat expiry
scott-kirk opened a new pull request #400:
URL: https://github.com/apache/curator/pull/400
If there is a problem posting the Expired KeeperState
during a session expiration, then the ZooKeeper event
thread will die without ever posting the Expired event.
This would then cause curator to keep trying to expire
the connection but it does nothing because the connection
is dead and no events will ever be posted.
This can be prevented by forcibly resetting the connection
if it's detected that the previous expiry had no effect
Same as #399, but from a different fork
--
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: dev-unsubscribe@curator.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [curator] asfgit merged pull request #400: [CURATOR-561] Reset connection after repeat expiry
Posted by GitBox <gi...@apache.org>.
asfgit merged pull request #400:
URL: https://github.com/apache/curator/pull/400
--
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: dev-unsubscribe@curator.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [curator] cammckenzie commented on pull request #400: [CURATOR-561] Reset connection after repeat expiry
Posted by GitBox <gi...@apache.org>.
cammckenzie commented on pull request #400:
URL: https://github.com/apache/curator/pull/400#issuecomment-963556960
Thanks for the PR @scott-kirk
--
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: dev-unsubscribe@curator.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [curator] scott-kirk commented on pull request #400: [CURATOR-561] Reset connection after repeat expiry
Posted by GitBox <gi...@apache.org>.
scott-kirk commented on pull request #400:
URL: https://github.com/apache/curator/pull/400#issuecomment-961493275
@cammckenzie Here's the new PR
--
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: dev-unsubscribe@curator.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [curator] martin-g commented on a change in pull request #400: [CURATOR-561] Reset connection after repeat expiry
Posted by GitBox <gi...@apache.org>.
martin-g commented on a change in pull request #400:
URL: https://github.com/apache/curator/pull/400#discussion_r814762078
##########
File path: curator-framework/src/test/java/org/apache/curator/framework/state/TestConnectionStateManager.java
##########
@@ -83,4 +89,43 @@ public void stateChanged(CuratorFramework client, ConnectionState newState)
CloseableUtils.closeQuietly(client);
}
}
+
+ @Test
+ public void testConnectionStateRecoversFromUnexpectedExpiredConnection() throws Exception {
+ Timing2 timing = new Timing2();
+ CuratorFramework client = CuratorFrameworkFactory.builder()
+ .connectString(server.getConnectString())
+ .connectionTimeoutMs(1_000)
+ .sessionTimeoutMs(250) // try to aggressively expire the connection
+ .retryPolicy(new RetryOneTime(1))
+ .connectionStateErrorPolicy(new SessionConnectionStateErrorPolicy())
+ .build();
+ final BlockingQueue<ConnectionState> queue = Queues.newLinkedBlockingQueue();
+ ConnectionStateListener listener = (client1, state) -> queue.add(state);
+ client.getConnectionStateListenable().addListener(listener);
+ client.start();
+ try {
+ ConnectionState polled = queue.poll(timing.forWaiting().seconds(), TimeUnit.SECONDS);
+ assertEquals(polled, ConnectionState.CONNECTED);
+ client.getZookeeperClient().getZooKeeper().getTestable().queueEvent(new WatchedEvent(
Review comment:
Possible fix: https://github.com/apache/curator/pull/409
--
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: dev-unsubscribe@curator.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [curator] martin-g commented on a change in pull request #400: [CURATOR-561] Reset connection after repeat expiry
Posted by GitBox <gi...@apache.org>.
martin-g commented on a change in pull request #400:
URL: https://github.com/apache/curator/pull/400#discussion_r814748733
##########
File path: curator-framework/src/test/java/org/apache/curator/framework/state/TestConnectionStateManager.java
##########
@@ -83,4 +89,43 @@ public void stateChanged(CuratorFramework client, ConnectionState newState)
CloseableUtils.closeQuietly(client);
}
}
+
+ @Test
+ public void testConnectionStateRecoversFromUnexpectedExpiredConnection() throws Exception {
+ Timing2 timing = new Timing2();
+ CuratorFramework client = CuratorFrameworkFactory.builder()
+ .connectString(server.getConnectString())
+ .connectionTimeoutMs(1_000)
+ .sessionTimeoutMs(250) // try to aggressively expire the connection
+ .retryPolicy(new RetryOneTime(1))
+ .connectionStateErrorPolicy(new SessionConnectionStateErrorPolicy())
+ .build();
+ final BlockingQueue<ConnectionState> queue = Queues.newLinkedBlockingQueue();
+ ConnectionStateListener listener = (client1, state) -> queue.add(state);
+ client.getConnectionStateListenable().addListener(listener);
+ client.start();
+ try {
+ ConnectionState polled = queue.poll(timing.forWaiting().seconds(), TimeUnit.SECONDS);
+ assertEquals(polled, ConnectionState.CONNECTED);
+ client.getZookeeperClient().getZooKeeper().getTestable().queueEvent(new WatchedEvent(
Review comment:
`#queueEvent(WatchedEvent)` is not available in Zookeeper 3.5.x and this breaks the build in current `master`:
```
[INFO] --- maven-surefire-plugin:3.0.0-M5:test (default-test) @ curator-test-zk35 ---
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
...
[INFO] Running org.apache.curator.framework.state.TestConnectionStateManager
[ERROR] Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 7.387 s <<< FAILURE! - in org.apache.curator.framework.state.TestConnectionStateManager
[ERROR] org.apache.curator.framework.state.TestConnectionStateManager.testConnectionStateRecoversFromUnexpectedExpiredConnection Time elapsed: 0.489 s <<< ERROR!
java.lang.NoSuchMethodError: org.apache.zookeeper.Testable.queueEvent(Lorg/apache/zookeeper/WatchedEvent;)V
at org.apache.curator.framework.state.TestConnectionStateManager.testConnectionStateRecoversFromUnexpectedExpiredConnection(TestConnectionStateManager.java:110)
[INFO] Running org.apache.curator.framework.state.TestConnectionStateManager
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.124 s <<< FAILURE! - in org.apache.curator.framework.state.TestConnectionStateManager
[ERROR] org.apache.curator.framework.state.TestConnectionStateManager.testConnectionStateRecoversFromUnexpectedExpiredConnection Time elapsed: 0.122 s <<< ERROR!
java.lang.NoSuchMethodError: org.apache.zookeeper.Testable.queueEvent(Lorg/apache/zookeeper/WatchedEvent;)V
at org.apache.curator.framework.state.TestConnectionStateManager.testConnectionStateRecoversFromUnexpectedExpiredConnection(TestConnectionStateManager.java:110)
...
```
--
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: dev-unsubscribe@curator.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [curator] scott-kirk commented on pull request #400: [CURATOR-561] Reset connection after repeat expiry
Posted by GitBox <gi...@apache.org>.
scott-kirk commented on pull request #400:
URL: https://github.com/apache/curator/pull/400#issuecomment-961493275
@cammckenzie Here's the new PR
--
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: dev-unsubscribe@curator.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [curator] scott-kirk commented on pull request #400: [CURATOR-561] Reset connection after repeat expiry
Posted by GitBox <gi...@apache.org>.
scott-kirk commented on pull request #400:
URL: https://github.com/apache/curator/pull/400#issuecomment-961493275
@cammckenzie Here's the new PR
--
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: dev-unsubscribe@curator.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org