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

KAFKA-3205 Support passive close by broker #1166

Closed
wants to merge 2 commits into from

Conversation

bondj
Copy link

@bondj bondj commented Mar 30, 2016

An attempt to fix KAFKA-3205. It appears the problem is that the broker has closed the connection passively, and the client should react appropriately.

In NetworkReceive.readFrom() rather than throw an EOFException (Which means the end of stream has been reached unexpectedly during input), instead return the negative bytes read signifying an acceptable end of stream.

In Selector if the channel is being passively closed, don't try to read any more data, don't try to write, and close the key.

I believe this will fix the problem.

@fpj
Copy link
Contributor

fpj commented Mar 31, 2016

@bondj the change seems sensible to me, it avoids printing the error messages with the stack trace. I'm not sure why you're being flooded with those messages in your log. If the producer reconnects, then shouldn't it produce another error only x minutes later, for whatever timeout you have? I'm trying to understand if this fully solves the problem you're reporting.

@bondj
Copy link
Author

bondj commented Apr 8, 2016

Thanks, we're rolling this fix out across production at the moment. Each server connects to enough brokers and we have many many brokers that this message was the top 'error' message across all our applications.

@bondj bondj closed this Apr 8, 2016
@ijuma
Copy link
Contributor

ijuma commented Apr 8, 2016

@bondj If this is a useful change, then you may consider submitting a PR with trunk as the target. That way, you will not have to patch again when you upgrade.

@bondj
Copy link
Author

bondj commented Apr 8, 2016

@ijuma Looking at the code, I think the problem is specific to 0.8 client talking 0.9 server. Hopefully, once we've upgraded our clients to 0.9 (which will take a while), we won't need the patch anymore.

@ijuma
Copy link
Contributor

ijuma commented Apr 8, 2016

@bondj OK, great.

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