{"record":{"id":"3f82d5bae725e52c","repo":"apache/cassandra","slug":"invalid-negative-latency-in-hint-delivery-delay","errorCode":null,"errorMessage":"Invalid negative latency in hint delivery delay: {}","messagePattern":"Invalid negative latency in hint delivery delay: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/metrics/HintsServiceMetrics.java","lineNumber":101,"sourceCode":"                                                                                               .build(address -> Metrics.histogram(factory.createMetricName(\"Hint_delays-\"+address.toString().replace(':', '.')), false));\n\n    // because at the time of static hintsFileSize being initialized,\n    // HintsService.instance is null / is not initialized yet so usage of method reference is not possible,\n    // so this is the workaround.\n    private static class TotalHintsSizeGauge implements Gauge<Long>, Serializable\n    {\n        @Override\n        public Long getValue()\n        {\n            return HintsService.instance.getTotalHintsSize();\n        }\n    }\n\n    public static void updateDelayMetrics(InetAddressAndPort endpoint, long delay)\n    {\n        if (delay <= 0)\n        {\n            logger.warn(\"Invalid negative latency in hint delivery delay: {}\", delay);\n            return;\n        }\n\n        globalDelayHistogram.update(delay);\n        delayByEndpoint.get(endpoint).update(delay);\n    }\n\n    public static long getDelayCount(InetAddressAndPort endpoint)\n    {\n        return delayByEndpoint.get(endpoint).getCount();\n    }\n}\n","sourceCodeStart":83,"sourceCodeEnd":114,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/metrics/HintsServiceMetrics.java#L83-L114","documentation":"HintsServiceMetrics.updateDelayMetrics guard: the computed hint delivery delay (current time minus hint creation timestamp) was negative, which is impossible under a monotonic clock; typically caused by clock skew between nodes. The bogus sample is logged and skipped.","triggerScenarios":"Thrown at src/java/org/apache/cassandra/metrics/HintsServiceMetrics.java:101 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check NTP/time synchronization on the nodes exchanging hints.","Ignore if transient; the sample is not recorded."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}