On 02/08/17 14:57, Christopher Schultz wrote: > Mark, > > On 8/1/17 4:17 PM, Mark Thomas wrote: >>>> Yes. To unlock the *acceptor thread(s)*. >>> >>> (Emphasis mine) >>> >>> I understand, now. Thanks. > >> The acceptor is also unlocked when a Connector is paused (i.e. when >> the server socket is NOT closed but it stops accepting new >> connections). > >>> Will a Thread.interrupt() not work? > >> For APR probably not. It might work for NIO but reading the Javadoc >> for accept() suggests an interrupt would close the connection (not >> what we want) > >>> What about calling socket.close() from the shutdown thread? That >>> should cause a SocketException to be thrown by accept()[1]. >>> >>> If it's an NIO SocketChannel, then we can close the channel >>> itself and cause an I/O interrupt.[2] > >> We need to be able to do this without closing the socket. It is >> that requirement that makes this 'interesting'. > > Is this because of the use-case above when we are merely "pausing" the > connector? Or is this because, even when shutting-down, we don't want > to close the socket and terminate any in-flight requests?
Bit of both. We want to stop any new requests while allowing in-flight requests to continue (for whatever the allowed perios is - 10s I think). > When playing-around with JMX and the connectors, I found sending a > "stop" request to the connector immediately kills all in-flight > connections. Is there an operation that is not available through JMX > that is being called here? Like "shutdown"? I'd expect the in-flight requests to complete and then close but idle keep-alive connections to close pretty much immediately. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org