jenkinsci/remoting — pull request #24 by kbrowder (2014-08-01 16:06:40+00:00)
Title: [JENKINS-24050] Fix issue where cancelled keys cause Jenkins NIO hub to die.

So I don't really have a good unittest, but I'm pretty sure the issue is fixed by checking if the key is valid even before reading, and also handling the CancelledKeyException (for good measure). The existing tests pass: https://travis-ci.org/kbrowder/remoting/builds/31436797.