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

Refresh metadata on any connection error #958

Closed
wants to merge 3 commits into from

Conversation

Nevon
Copy link
Collaborator

@Nevon Nevon commented Nov 13, 2020

In case we get a connection timeout, we currently don't refresh metadata in all cases, only if we get an ECONNREFUSED.

Fixes #950 with the help of @smartinio.

In case we get a connection timeout, we currently don't refresh metadata in all cases. Fixes #950.
@Nevon Nevon requested a review from tulios November 13, 2020 15:08
Co-authored-by: Sam <me@smartin.io>
@Nevon
Copy link
Collaborator Author

Nevon commented Nov 16, 2020

The test that was checking that the broker connection was rebuilt on ILLEGAL_SASL_STATE was actually invalid. It was throwing a generic KafkaJSConnectionError - which is retriable - when in reality there would be a non-retriable KafkaJSProtocolError. Updating Broker.connect to bail on any connection error (not just ECONNREFUSED) caused this test to start (correctly) failing.

Now the test is updated so that on ILLEGAL_SASL_STATE we rebuild the connection and throw a new retriable version of the protocol error so that the connection gets retried.

@Nevon
Copy link
Collaborator Author

Nevon commented Nov 16, 2020

This PR is superseded by #962 as it moves the responsibility of refreshing metadata into sendMessages.

@Nevon Nevon closed this Nov 16, 2020
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.

Metadata is not refreshed on connection errors
1 participant