[ 
https://issues.apache.org/jira/browse/CASSANDRA-3335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jonathan Ellis updated CASSANDRA-3335:
--------------------------------------

    Attachment: 3335-v4.txt

Okay, take four here.  The problem with v3 is that we were only blocking 
sendOneWay during shutdown, not addCallback, which is the source of the 
ExpiringMap entries we were waiting for.

As I commented,

{noformat}
    /**
     * There isn't a good way to shut down the MessagingService. One problem 
(but not the only one)
     * is that StorageProxy has no way to communicate back to clients, "I'm 
nominally alive, but I can't
     * send that request to the nodes with your data."  Neither TimedOut nor 
Unavailable is appropriate
     * to return in that situation.
     *
     * So instead of shutting down MS and letting StorageProxy/clients cope 
somehow, we shut down
     * the Thrift service and then wait for all the outstanding requests to 
finish or timeout.
     */
{noformat}

That part was straightforward.  I also had to make the Thrift shutdown actually 
work -- we were calling setSoTimeout to attempt to make accept() nonblocking, 
but "0" means "wait indefinitely" not "don't wait at all".  Then we needed to 
handle the timeout in the accept loop.

Finally, I did a bunch of cleanup to ExpiringMap and added trace-level logging 
in case we need to go at this *again*.



                
> ThreadPoolExecutor creates threads as non-daemon and will block on shutdown 
> by default
> --------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-3335
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3335
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Brandon Williams
>            Assignee: Jonathan Ellis
>            Priority: Minor
>             Fix For: 1.0.7
>
>         Attachments: 3335-v2.txt, 3335-v3.txt, 3335-v4.txt, 3335.txt, 
> 3335v3_jstack.txt
>
>
> This is most obviously visible in OptionalTasks which should not block 
> shutdown, but often does.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to