[
https://issues.apache.org/jira/browse/AMQ-5269?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14057831#comment-14057831
]
Daniel Kulp commented on AMQ-5269:
----------------------------------
On my Mac:
Before:
{code}
Running org.apache.activemq.transport.stomp.Stomp11NIOSSLTest
Tests run: 27, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 126.509 sec -
in org.apache.activemq.transport.stomp.Stomp11NIOSSLTest
Running org.apache.activemq.transport.stomp.Stomp11NIOTest
Tests run: 27, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 124.051 sec -
in org.apache.activemq.transport.stomp.Stomp11NIOTest
Running org.apache.activemq.transport.stomp.Stomp11SslAuthTest
Tests run: 27, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 73.105 sec -
in org.apache.activemq.transport.stomp.Stomp11SslAuthTest
{code}
After:
{code}
Running org.apache.activemq.transport.stomp.Stomp11NIOSSLTest
Tests run: 27, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 71.824 sec -
in org.apache.activemq.transport.stomp.Stomp11NIOSSLTest
Running org.apache.activemq.transport.stomp.Stomp11NIOTest
Tests run: 27, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 70.408 sec -
in org.apache.activemq.transport.stomp.Stomp11NIOTest
Running org.apache.activemq.transport.stomp.Stomp11SslAuthTest
Tests run: 27, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 72.747 sec -
in org.apache.activemq.transport.stomp.Stomp11SslAuthTest
{code}
> NIO transports using blocking accept calls, very slow shutdown
> --------------------------------------------------------------
>
> Key: AMQ-5269
> URL: https://issues.apache.org/jira/browse/AMQ-5269
> Project: ActiveMQ
> Issue Type: Bug
> Components: Transport
> Affects Versions: 5.10.0
> Reporter: Daniel Kulp
> Assignee: Daniel Kulp
> Attachments: AMQ-5269.patch
>
>
> Currently, all the TCP based transports are using the old blocking style of
> socket.accept() to accept connections. This works "OK" except that for
> sockets that have a channel associated with them, the socket.close() doesn't
> cause it to return immediately. It still waits for the SoTimeout which is
> currently set a 2 seconds. That can cause 2 second delays for any shutdown
> which causes long, unnecessary delays, particularly in the tests.
> One possible "fix" is to drop the socket.setSoTimeout(2000) call to something
> much smaller. However, that would turn the accept thread into a more "busy
> wait" scenario which is undesirable.
> A better fix is to change the accepts for the sockets that have a
> ServerSocketChannel to use the NIO based selectors for the accept operations.
> The selector.disable()/selector.close() allows the socket and everything to
> close immediately. The result is that the NIO based tests now take the same
> amount of time as the non-NIO based tests (for which socket.close() causes
> the accept to return immediately).
> Pull request forthcoming.
--
This message was sent by Atlassian JIRA
(v6.2#6252)