[ 
https://issues.apache.org/jira/browse/CASSANDRA-14815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16708609#comment-16708609
 ] 

Alex Petrov commented on CASSANDRA-14815:
-----------------------------------------

[~benedict] Thank you for the review,

You're right, I haven't noticed there are other calls to {{set}} that would 
overwrite this state; CAS this used only during transition between executors, 
and all the other time worker is an exclusive owner. I did have a similar 
version to yours, but the way I implemented it initially (atomic boolean for 
stop signal and waiting twice on descheduled and once on spinning queues to 
make sure all tasks are drained), but thought we can do better. I like your 
version, however as it improves in terms of how we signal shutdown without 
having to spin.

I've pushed two minor suggestions: one is to take break out of the nested if 
and second - remove (seemingly) redundant call to {{terminateWorkers}}, let me 
know what you think.

> SEPExecutor does not fully shut down
> ------------------------------------
>
>                 Key: CASSANDRA-14815
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14815
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Lifecycle
>            Reporter: Alex Petrov
>            Assignee: Alex Petrov
>            Priority: Minor
>
> When trying to shut down an SEP Executor, a parked worked will still be 
> parked on:
> {code}
> sun.misc.Unsafe.park(Native Method)
> java.util.concurrent.locks.LockSupport.park(LockSupport.java:304)
> org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:88)
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
> java.lang.Thread.run(Thread.java:748)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to