{"record":{"id":"cccc0268da3c39ea","repo":"apache/cassandra","slug":"gossiper-unsafeassassinateendpoint-is-deprecated-a","errorCode":null,"errorMessage":"Gossiper.unsafeAssassinateEndpoint is deprecated and will be removed in the next release; use assassinateEndpoint instead","messagePattern":"Gossiper\\.unsafeAssassinateEndpoint is deprecated and will be removed in the next release; use assassinateEndpoint instead","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/gms/Gossiper.java","lineNumber":813,"sourceCode":"            }\n            gDigests.add(new GossipDigest(entry.getKey(), generation, maxVersion));\n        }\n\n        if (logger.isTraceEnabled())\n        {\n            StringBuilder sb = new StringBuilder();\n            for (GossipDigest gDigest : gDigests)\n            {\n                sb.append(gDigest);\n                sb.append(' ');\n            }\n            logger.trace(\"Gossip Digests are : {}\", sb);\n        }\n    }\n\n    public void unsafeAssassinateEndpoint(String address) throws UnknownHostException\n    {\n        logger.warn(\"Gossiper.unsafeAssassinateEndpoint is deprecated and will be removed in the next release; use assassinateEndpoint instead\");\n        assassinateEndpoint(address);\n    }\n\n    /**\n     * Do not call this method unless you know what you are doing.\n     * It will try extremely hard to obliterate any endpoint from the ring,\n     * even if it does not know about it.\n     *\n     * @param address\n     * @throws UnknownHostException\n     */\n    public void assassinateEndpoint(String address) throws UnknownHostException\n    {\n        InetAddressAndPort endpoint = InetAddressAndPort.getByName(address);\n        Assassinate.assassinateEndpoint(endpoint);\n    }\n\n    public boolean isKnownEndpoint(InetAddressAndPort endpoint)","sourceCodeStart":795,"sourceCodeEnd":831,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/gms/Gossiper.java#L795-L831","documentation":"unsafeAssassinateEndpoint is a deprecated wrapper around assassinateEndpoint that logs a deprecation warning on every call. It exists for backward compatibility with older nodetool/scripts; it performs the same dangerous operation of forcing an endpoint out of the ring regardless of its actual state.","triggerScenarios":"Calling Gossiper.unsafeAssassinateEndpoint(address) directly, or running an old nodetool 'assassinate' variant that targets the deprecated method.","commonSituations":"Operators removing a dead node with outdated tooling or scripts copied from old runbooks; JMX clients invoking the deprecated MBean operation.","solutions":["Switch to assassinateEndpoint (or the current nodetool assassinate) instead of the unsafe variant.","Prefer decommission/removenode over assassination whenever the node can communicate.","If assassination is required, ensure the node is truly dead and update automation to call the non-deprecated API.","Remove usages from scripts/JMX automation before the next major release where the method is deleted."],"exampleFix":"// before\nGossiper.instance.unsafeAssassinateEndpoint(\"10.0.0.5\");\n// after\nGossiper.instance.assassinateEndpoint(\"10.0.0.5\");","handlingStrategy":"fallback","validationCode":"// prefer non-deprecated path\nboolean canCommunicate = Gossiper.instance.getEndpointStateForEndpoint(ep) != null && Gossiper.instance.isAlive(ep);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use decommission/removenode first; assassinate only as last resort.","Grep scripts/automation for unsafeAssassinateEndpoint and migrate to assassinateEndpoint.","Treat deprecation warnings in logs as migration TODOs."],"tags":["cassandra","gossip","deprecation","node-operations"],"backgroundTag":"deprecated-api-usage","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}