[
https://issues.apache.org/jira/browse/CASSANDRA-11984?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15324671#comment-15324671
]
Stefania commented on CASSANDRA-11984:
--------------------------------------
+1, this variable should definitely be volatile.
I think we should commit in 2.2+ at a minimum, possibly 2.1 as well.
It shouldn't make a difference but I'm running the tests on 2.2 anyway, I will
commit once the tests complete:
|[patch|https://github.com/stef1927/cassandra/commits/11984-2.2]|[testall|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-11984-2.2-testall/]|[dtest|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-11984-2.2-dtest/]|
> StorageService shutdown hook should use a volatile variable
> -----------------------------------------------------------
>
> Key: CASSANDRA-11984
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11984
> Project: Cassandra
> Issue Type: Bug
> Reporter: Edward Capriolo
> Assignee: Edward Capriolo
> Fix For: 3.8
>
>
> In StorageService.java there is a variable accessed from other threads that
> is not marked volatile.
> {noformat}
> private boolean inShutdownHook = false;
> public boolean isInShutdownHook()
> {
> return inShutdownHook;
> }
> drainOnShutdown = new Thread(new WrappedRunnable()
> {
> @Override
> public void runMayThrow() throws InterruptedException
> {
> inShutdownHook = true;
> {noformat}
> This is called from at least here:
> {noformat}
> ./src/java/org/apache/cassandra/concurrent/DebuggableScheduledThreadPoolExecutor.java:
> if (!StorageService.instance.isInShutdownHook())
> {noformat}
> This could cause issues in controlled shutdown like drain commands.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)