mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-23 04:24:49 +02:00
8169358: httpserver does not close connections when RejectedExecutionException occurs
Catch unexpected exceptions in Dispatcher::handle Reviewed-by: chegar, dfuchs, clanger
This commit is contained in:
parent
c866d037bc
commit
605827c671
2 changed files with 111 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -395,7 +395,6 @@ class ServerImpl implements TimeSource {
|
|||
} else {
|
||||
try {
|
||||
if (key.isReadable()) {
|
||||
boolean closed;
|
||||
SocketChannel chan = (SocketChannel)key.channel();
|
||||
HttpConnection conn = (HttpConnection)key.attachment();
|
||||
|
||||
|
@ -437,7 +436,6 @@ class ServerImpl implements TimeSource {
|
|||
}
|
||||
|
||||
public void handle (SocketChannel chan, HttpConnection conn)
|
||||
throws IOException
|
||||
{
|
||||
try {
|
||||
Exchange t = new Exchange (chan, protocol, conn);
|
||||
|
@ -448,6 +446,9 @@ class ServerImpl implements TimeSource {
|
|||
} catch (IOException e) {
|
||||
logger.log (Level.TRACE, "Dispatcher (5)", e);
|
||||
closeConnection(conn);
|
||||
} catch (Throwable e) {
|
||||
logger.log (Level.TRACE, "Dispatcher (6)", e);
|
||||
closeConnection(conn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue