cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edward Capriolo (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-11984) StorageService shutdown hook should use a volatile variable
Date Thu, 09 Jun 2016 01:38:21 GMT

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

Edward Capriolo commented on CASSANDRA-11984:
---------------------------------------------

https://github.com/apache/cassandra/compare/trunk...edwardcapriolo:CASSANDRA-11984?expand=1

> 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)

Mime
View raw message