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 29850200B9D for ; Thu, 29 Sep 2016 05:46:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 282EA160AD3; Thu, 29 Sep 2016 03:46:23 +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 6A778160ADD for ; Thu, 29 Sep 2016 05:46:22 +0200 (CEST) Received: (qmail 82088 invoked by uid 500); 29 Sep 2016 03:46: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 81922 invoked by uid 99); 29 Sep 2016 03:46:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Sep 2016 03:46:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 1654A2C2A67 for ; Thu, 29 Sep 2016 03:46:21 +0000 (UTC) Date: Thu, 29 Sep 2016 03:46:21 +0000 (UTC) From: "Stefania (JIRA)" To: commits@cassandra.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CASSANDRA-12461) Add hooks to StorageService shutdown MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 29 Sep 2016 03:46:23 -0000 [ https://issues.apache.org/jira/browse/CASSANDRA-12461?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15531686#comment-15531686 ] Stefania commented on CASSANDRA-12461: -------------------------------------- It LGTM, with these two changes: * I ill advised you yesterday regarding replacing the boolean with the operating mode, because we are not updating it atomically and we are not guarding against unwanted transitions, due to some bug somewhere, e.g. DRAINED -> DECOMMISSIONED or DRAINED -> NORMAL. I did not want to handle all this and check all the callers of {{setMode}} and so I've reintroduced the boolean, I merely renamed it to {{isShutdown}}. * I think we could have races if we check that a node is drained before starting a service with two JMX calls. I move the check in the SS methods and made them synchronized. |[patch|https://github.com/stef1927/cassandra/commits/12461]|[testall|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-12461-testall/]|[dtest|http://cassci.datastax.com/view/Dev/view/stef1927/job/stef1927-12461-dtest/]| Let me know if you are OK with these two changes, if so, should we also back-port to 3.0? > Add hooks to StorageService shutdown > ------------------------------------ > > Key: CASSANDRA-12461 > URL: https://issues.apache.org/jira/browse/CASSANDRA-12461 > Project: Cassandra > Issue Type: Bug > Reporter: Anthony Cozzie > Assignee: Anthony Cozzie > Fix For: 3.x > > Attachments: 0001-CASSANDRA-12461-add-C-support-for-shutdown-runnables.patch > > > The JVM will usually run shutdown hooks in parallel. This can lead to synchronization problems between Cassandra, services that depend on it, and services it depends on. This patch adds some simple support for shutdown hooks to StorageService. > This should nearly solve CASSANDRA-12011 -- This message was sent by Atlassian JIRA (v6.3.4#6332)