-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Java Client] Send CloseConsumer on client timeout #16616
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
eolivelli
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
we should port this to 2.10 and other active branches
@michaeljmarshall were there other issues or was it only about a warning in the logs? |
+1, and a question, what if the close consumer command times out? |
|
closed/reopened to trigger CI |
(cherry picked from commit 8f31655)
(cherry picked from commit 8f31655)
(cherry picked from commit 8f31655)
### Motivation This change is the same as apache/pulsar#13161 and apache/pulsar#16616, and is justified by these lines of our binary protocol spec: * https://github.com/apache/pulsar-site/blob/9b4b3d39014bd47c0bb9f66742b89bcb40ed7f07/docs/developing-binary-protocol.md?plain=1#L301-L304 * https://github.com/apache/pulsar-site/blob/9b4b3d39014bd47c0bb9f66742b89bcb40ed7f07/docs/developing-binary-protocol.md?plain=1#L468-L471 ### Modifications * When a producer or a consumer times out during creation, make an attempt to close the producer or consumer by sending the appropriate close command. Failures can safely be ignored because the only time that the close will actually matter is when the TCP connection is open for other protocol messages. The one nuance is that we send the close command to the same address pair that we send the create command.
### Motivation This change is the same as apache/pulsar#13161 and apache/pulsar#16616, and is justified by these lines of our binary protocol spec: * https://github.com/apache/pulsar-site/blob/9b4b3d39014bd47c0bb9f66742b89bcb40ed7f07/docs/developing-binary-protocol.md?plain=1#L301-L304 * https://github.com/apache/pulsar-site/blob/9b4b3d39014bd47c0bb9f66742b89bcb40ed7f07/docs/developing-binary-protocol.md?plain=1#L468-L471 ### Modifications * When a producer or a consumer times out during creation, make an attempt to close the producer or consumer by sending the appropriate close command. Failures can safely be ignored because the only time that the close will actually matter is when the TCP connection is open for other protocol messages. The one nuance is that we send the close command to the same address pair that we send the create command. (cherry picked from commit d4e08c6)
Related: #13161 and #12948
Motivation
The current Java Client consumer code does not clean up a pending consumer on the server when the client's timeout expires. This creates problems when the client tries to recreate the consumer with a
Subscribecommand. In this case, we see warnings like the following:Modifications
CloseConsumercommand when theSubscribecommand times out from the client perspective.Verifying this change
This change includes new tests.
Does this pull request potentially affect one of the following parts:
This change introduces new recommendation for the Pulsar Protocol, but it does not make any breaking changes.
Note also that the C++ client already follows this behavior.
Documentation
doc