{"record":{"id":"88408acc02b701e0","repo":"apache/cassandra","slug":"disabling-gossip-while-native-transport-is-still-a","errorCode":null,"errorMessage":"Disabling gossip while native transport is still active is unsafe","messagePattern":"Disabling gossip while native transport is still active is unsafe","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/StorageService.java","lineNumber":551,"sourceCode":"\n    public void unregister(IEndpointLifecycleSubscriber subscriber)\n    {\n        lifecycleSubscribers.remove(subscriber);\n    }\n\n    // should only be called via JMX\n    public void stopGossiping()\n    {\n        if (isGossipRunning())\n        {\n            if (!isNormal() && joinRing)\n                throw new IllegalStateException(\"Unable to stop gossip because the node is not in the normal state. Try to stop the node instead.\");\n\n            logger.warn(\"Stopping gossip by operator request\");\n\n            if (isNativeTransportRunning())\n            {\n                logger.warn(\"Disabling gossip while native transport is still active is unsafe\");\n            }\n\n            Gossiper.instance.stop();\n        }\n    }\n\n    // should only be called via JMX\n    public synchronized void startGossiping()\n    {\n        if (!isGossipRunning())\n        {\n            checkServiceAllowedToStart(\"gossip\");\n\n            logger.warn(\"Starting gossip by operator request\");\n            Collection<Token> tokens = SystemKeyspace.getSavedTokens();\n\n            boolean validTokens = tokens != null && !tokens.isEmpty();\n","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageService.java#L533-L569","documentation":"WARN log from StorageService.stopGossiping() warning that gossip is being disabled while the native transport (CQL client protocol) is still running. The call still proceeds, but the node keeps accepting client connections while no longer exchanging membership/ring state via gossip, which is unsafe and can cause stale routing and inconsistent views.","triggerScenarios":"stopGossiping() called when isNativeTransportRunning() returns true — i.e. operator disables gossip before stopping the CQL native protocol server.","commonSituations":"Incomplete shutdown sequences where an operator or script disables gossip but forgets native transport; partial transport shutdowns via JMX during incident response.","solutions":["Re-enable gossip ('nodetool enablegossip') or disable native transport ('nodetool disablebinary') to reach a consistent state.","Adjust shutdown scripts to stop native transport before gossip.","Plan a restart if the node served traffic during the gossip-outage window to refresh ring state."],"exampleFix":"// before (shell)\nnodetool disablegossip\n// after (shell)\nnodetool disablebinary\nnodetool disablegossip","handlingStrategy":"validation","validationCode":"if (storageService.isNativeTransportRunning()) {\n    throw new IllegalStateException(\"Disable native transport before disabling gossip\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Order shutdown steps: disablebinary, then disablegossip.","Automate shutdown via scripts that enforce ordering.","Audit nodes for gossip-disabled-but-serving state after incidents."],"tags":["cassandra","gossip","native-transport","unsafe-state"],"backgroundTag":"invalid-state-transition","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}