You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Alex Petrov (JIRA)" <ji...@apache.org> on 2016/09/29 13:19:20 UTC
[jira] [Updated] (CASSANDRA-12509) Shutdown process triggered twice
during if the node is drained
[ https://issues.apache.org/jira/browse/CASSANDRA-12509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Petrov updated CASSANDRA-12509:
------------------------------------
Assignee: Alex Petrov
Reviewer: Stefania
Status: Patch Available (was: Open)
Moving the bugfix here from [CASSANDRA-12461], re-triggering CI:
|[12509-trunk|https://github.com/ifesdjeen/cassandra/tree/12509-trunk]|[dtest|http://cassci.datastax.com/job/ifesdjeen-12509-trunk-dtest/]|[utest|http://cassci.datastax.com/job/ifesdjeen-12509-trunk-testall/]|
|[12509-3.0|https://github.com/ifesdjeen/cassandra/tree/12509-3.0]|[dtest|http://cassci.datastax.com/job/ifesdjeen-12509-3.0-dtest/]|[utest|http://cassci.datastax.com/job/ifesdjeen-12509-3.0-testall/]|
> Shutdown process triggered twice during if the node is drained
> --------------------------------------------------------------
>
> Key: CASSANDRA-12509
> URL: https://issues.apache.org/jira/browse/CASSANDRA-12509
> Project: Cassandra
> Issue Type: Bug
> Reporter: Alex Petrov
> Assignee: Alex Petrov
>
> If the node is drained, the {{StorageService#drain}} [method|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/StorageService.java#L4212] is called, which triggers shutdown of mutation stage, messaging service, compaction, batchlog etc. In the end of this process, the node is moved to {{DRAINED}} status with the process still running.
> When JVM is shutdown, the JVM shutdown hooks are ran, which are subscribed during the server initialisation: {{Runtime.getRuntime().addShutdownHook(drainOnShutdown);}} [here|https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/service/StorageService.java#L575-L636].
> I noticed this behaviour while reviewing [CASSANDRA-12461], as if we'd like add custom pre and post-shutdown hooks, most likely it makes sense to run them once (or user might expect such behaviour).
> Is this behaviour correct? Should we run whole shutdown process twice or just once in "drain" and no-op during JVM shutdown?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)