activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <>
Subject [jira] [Updated] (AMQ-5269) NIO transports using blocking accept calls, very slow shutdown
Date Thu, 10 Jul 2014 16:36:04 GMT


Daniel Kulp updated AMQ-5269:

    Attachment: AMQ-5269.patch

Attaching a patch for now as my "git" stuff is in a bit of a mess and I need to clean that

> NIO transports using blocking accept calls, very slow shutdown
> --------------------------------------------------------------
>                 Key: AMQ-5269
>                 URL:
>             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

View raw message