Protect against NPE that will cause Poller to fail
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@
1055458 13f79535-47bb-0310-9956-
ffa450edef68
while (iterator != null && iterator.hasNext()) {
SelectionKey sk = iterator.next();
KeyAttachment attachment = (KeyAttachment)sk.attachment();
- attachment.access();
- iterator.remove();
- processKey(sk, attachment);
+ // Attachment may be null if another thread has called
+ // cancelledKey()
+ if (attachment == null) {
+ iterator.remove();
+ } else {
+ attachment.access();
+ iterator.remove();
+ processKey(sk, attachment);
+ }
}//while
//process timeouts
Remove a huge memory leak in the NIO connector introduced by the fix
for <bug>49884</bug>. (markt)
</fix>
+ <fix>
+ <bug>50467</bug>: Protected against NPE triggered by a race condition
+ that causes the NIO poller to fail, preventing the processing of further
+ requests. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">