GitHub user ijuma opened a pull request: https://github.com/apache/kafka/pull/1017
KAFKA-3341: Improve error handling on invalid requests * Include request id when parsing of request header fails * Don't mute selector on a connection that was closed due to an error (otherwise a second exception is thrown) * Throw appropriate exception from `ApiKeys.fromId` if invalid id is passed I ran into the top two issues while trying to figure out why a connection from a producer to a broker was failing (and it made things harder than necessary). While fixing them, I noticed the third issue. You can merge this pull request into a Git repository by running: $ git pull https://github.com/ijuma/kafka kafka-3341-improve-error-handling-invalid-requests Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/1017.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1017 ---- commit 4508da56e132b2e9b09fb03b3a1215608b539171 Author: Ismael Juma <ism...@juma.me.uk> Date: 2016-03-06T16:16:48Z Throw more informative exception if wrong id is passed to `ApiKeys.forId` commit 7530e001e97d34f1d55f217617f99e264d91f119 Author: Ismael Juma <ism...@juma.me.uk> Date: 2016-03-06T16:20:16Z Don't try to mute selector if it has already been closed commit 0f93c33b29ad77677bf7dda72012f15fc0346ad9 Author: Ismael Juma <ism...@juma.me.uk> Date: 2016-03-06T23:57:47Z Include request id when parsing of request header fails Similar to what we do when creating the request fails. ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---