Skip to content
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

Fix producer unable register when cnx closed #761

Merged

Conversation

wolfstudy
Copy link
Member

Signed-off-by: xiaolongran xiaolongran@tencent.com

Motivation

At present, it is assumed that there are multiple topics multiplexing the same TCP connection, then any topic may trigger the reconnection operation of this TCP connection. In the actual production environment, we see that a small number of producers will report the following errors:

time="2022-04-19T21:43:28+08:00" level=warning msg="Connection closed unable register listener id=41" local_addr="9.xcxx:43051" remote_addr="pulsar://1.xxxx:6650"

The specific code logic is as follows:

https://github.com/apache/pulsar-client-go/blob/master/pulsar/internal/connection.go#L851-L855

We can see that when we try to register the producer, we will first check the status of the current connection. If the connection is closed, then we will not continue to register the producer object with the connection, but at the same time we will not do any processing and cause some topics to continue to hold the old connection before, causing the sending to time out.

Modifications

  • return an error when unable to register listener

Signed-off-by: xiaolongran <xiaolongran@tencent.com>
@wolfstudy wolfstudy added this to the v0.9.0 milestone Apr 20, 2022
@wolfstudy wolfstudy self-assigned this Apr 20, 2022
Signed-off-by: xiaolongran <xiaolongran@tencent.com>
@wolfstudy wolfstudy merged commit e3f625a into apache:master Apr 20, 2022
@lhotari
Copy link
Member

lhotari commented Apr 26, 2022

I created a related issue #766 . @wolfstudy @zymap please take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants