You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Steps to Reproduce
To test the reconnection robustness of our app, we have a simple test script which periodically enables/disables the firewall ports to kafka and DNS. This will check and ensure the app reconnects to kafka in the event of a network outage.
We listen to the connection.failure event and perform a retry:
Very rarely, the consumer will end up being disconnected and the event above is never called, which causes the app to stop consuming from the server. We tracked it down to the Client.prototype.connect method in lib\client.js:
var fail = function(err) {
...
if (self._isConnected) {
...
self.emit('connection.failure', err, self.metrics);
} else {
next(err);
}
If the connection happens to be disconnected, the connection.failure event will not be emitted. The fix would be to emit the event even when the state is disconnected:
Environment Information
Steps to Reproduce
To test the reconnection robustness of our app, we have a simple test script which periodically enables/disables the firewall ports to kafka and DNS. This will check and ensure the app reconnects to kafka in the event of a network outage.
We listen to the connection.failure event and perform a retry:
Very rarely, the consumer will end up being disconnected and the event above is never called, which causes the app to stop consuming from the server. We tracked it down to the Client.prototype.connect method in lib\client.js:
If the connection happens to be disconnected, the connection.failure event will not be emitted. The fix would be to emit the event even when the state is disconnected:
Our workaround at the moment is to register a callback to the connect() method and reconnect from there as well.
The text was updated successfully, but these errors were encountered: