This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new 981a5f2 Restore try catch around Poller.events 981a5f2 is described below commit 981a5f287720abeb67c3ae9f4336ec8da4f71f0f Author: remm <r...@apache.org> AuthorDate: Tue Oct 27 16:52:26 2020 +0100 Restore try catch around Poller.events This is a regression caused when the Poller.events method was refactored. --- java/org/apache/tomcat/util/net/NioEndpoint.java | 8 ++++---- webapps/docs/changelog.xml | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index d7afa0e..827fa08 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -720,15 +720,15 @@ public class NioEndpoint extends AbstractJsseEndpoint<NioChannel,SocketChannel> } break; } + // Either we timed out or we woke up, process events first + if (keyCount == 0) { + hasEvents = (hasEvents | events()); + } } catch (Throwable x) { ExceptionUtils.handleThrowable(x); log.error(sm.getString("endpoint.nio.selectorLoopError"), x); continue; } - // Either we timed out or we woke up, process events first - if (keyCount == 0) { - hasEvents = (hasEvents | events()); - } Iterator<SelectionKey> iterator = keyCount > 0 ? selector.selectedKeys().iterator() : null; diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index ddd15a7..0689c1d 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -107,6 +107,11 @@ <bug>63362</bug>: Add collection of statistics for HTTP/2, WebSocket and connections upgraded via the HTTP upgrade mechanism. (markt) </fix> + <fix> + Restore exception catch around Poller.events, as it would cause + the NIO poller thread to exit. This is a regression caused when + the Poller.events method was refactored. (remm) + </fix> </changelog> </subsection> <subsection name="Jasper"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org