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

Short-circuit BrokerConnection.close() if already disconnected #1424

Merged
merged 1 commit into from
Mar 9, 2018

Conversation

dpkp
Copy link
Owner

@dpkp dpkp commented Mar 9, 2018

Separated from #1411 . It is fairly common when handling a connection error for us to call self.close(error) inside BrokerConnection, return an error to the caller, and for the caller -- usually KafkaClient -- to call conn.close() again. Right now this causes connection errors to be double logged, which can seem strange. The PR simply checks whether the connection is already disconnected, and if so it does nothing. We assume that the only way to get a BrokerConnection object into the disconnected state is via close()

@dpkp dpkp merged commit 4cbeb2e into master Mar 9, 2018
@dpkp dpkp deleted the conn_close_short_circuit branch March 9, 2018 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant