Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E7137200B32 for ; Thu, 9 Jun 2016 03:38:22 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E5D85160A2E; Thu, 9 Jun 2016 01:38:22 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 464E7160A35 for ; Thu, 9 Jun 2016 03:38:22 +0200 (CEST) Received: (qmail 68370 invoked by uid 500); 9 Jun 2016 01:38:21 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 68311 invoked by uid 99); 9 Jun 2016 01:38:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Jun 2016 01:38:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 09EA82C1F60 for ; Thu, 9 Jun 2016 01:38:21 +0000 (UTC) Date: Thu, 9 Jun 2016 01:38:21 +0000 (UTC) From: "Edward Capriolo (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-11984) StorageService shutdown hook should use a volatile variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 09 Jun 2016 01:38:23 -0000 [ 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)