-
Notifications
You must be signed in to change notification settings - Fork 346
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
When topic is terminated. Client must not retry connecting to broker. #1128
Merged
RobertIndie
merged 1 commit into
apache:master
from
pkumar-singh:support_topic_termination
Nov 16, 2023
Merged
When topic is terminated. Client must not retry connecting to broker. #1128
RobertIndie
merged 1 commit into
apache:master
from
pkumar-singh:support_topic_termination
Nov 16, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gunli
reviewed
Nov 14, 2023
21d9b7b
to
7692e27
Compare
RobertIndie
reviewed
Nov 15, 2023
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.
Could you add some tests to verify it?
7692e27
to
71d01d5
Compare
…essages should be failed
71d01d5
to
e5e501a
Compare
Done.! |
RobertIndie
approved these changes
Nov 16, 2023
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. Thanks!
1 task
pkumar-singh
added a commit
to pkumar-singh/pulsar-client-go
that referenced
this pull request
Nov 21, 2023
…ding messages should be failed (apache#1128) GoLang Pulsar client library has no support for Topic termination. When a topic is terminated following should happen at client library side. 1. Producers should stop reconnecting. As once topic is terminated, it is permanent. 2. All the pending messages should be failed. If reconnect is failing with TopicTerminated error. Run through the pending messages queue and complete the callback. After that exit the reconnect loop and set producer state as closing. Marking producer state producerClosing will ensure that new messages are immediately failed. Co-authored-by: Prashant Kumar <[email protected]>
RobertIndie
pushed a commit
that referenced
this pull request
Dec 8, 2023
…uotaExceededException/ProducerFenced when reconnecting (#1134) Master Issue: #1128 ### Motivation In Java client, when we get TopicNotFound/TopicTerminated/ProducerBlockedQuotaExceededException/ProducerFenced, we should failPendingMessages, and close producer. But in Go client, we forget to handle ProducerBlockedQuotaExceededException/ProducerFenced, and in #1128, we just call sr.done(), actually we should call failPendingMessages(). https://github.com/apache/pulsar-client-go/pull/1128/files https://github.com/apache/pulsar/blob/master/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ProducerImpl.java#L1663 ### Modifications 1. rename `errMsgTopicNotFount` to `errMsgTopicNotFound` 2. handle TopicTerminated/ProducerBlockedQuotaExceededException/ProducerFenced, call `failPendingMessages()`; --------- Co-authored-by: gunli <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
GoLang Pulsar client library has no support for Topic termination.
When a topic is terminated following should happen at client library side.
Modifications
If reconnect is failing with TopicTerminated error.
Run through the pending messages queue and complete the callback.
After that exit the reconnect loop and set producer state as closing.
Marking producer state producerClosing will ensure that new messages are immediately failed.