{"record":{"id":"82d5cceb5609dd26","repo":"apache/cassandra","slug":"exception-occurred-updating-coordinatorwritelatenc","errorCode":null,"errorMessage":"Exception occurred updating coordinatorWriteLatency metric","messagePattern":"Exception occurred updating coordinatorWriteLatency metric","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/StorageProxy.java","lineNumber":1640,"sourceCode":"                    ColumnFamilyStore store = keyspace.getColumnFamilyStore(tableId);\n                    if (firstColumnFamilyStore == null)\n                    {\n                        store.metric.coordinatorWriteLatency.update(latency, NANOSECONDS);\n                        firstColumnFamilyStore = store;\n                    }\n                    else if (!firstColumnFamilyStore.equals(store))\n                    {\n                        if (uniqueColumnFamilyStores == null)\n                            uniqueColumnFamilyStores = new HashSet<>();\n                        if (uniqueColumnFamilyStores.add(store))\n                            store.metric.coordinatorWriteLatency.update(latency, NANOSECONDS);\n                    }\n                }\n            }\n        }\n        catch (Exception ex)\n        {\n            logger.warn(\"Exception occurred updating coordinatorWriteLatency metric\", ex);\n        }\n    }\n\n    private static void syncWriteToBatchlog(Collection<Mutation> mutations, ReplicaPlan.ForWrite replicaPlan, TimeUUID uuid, Dispatcher.RequestTime requestTime)\n    throws WriteTimeoutException, WriteFailureException\n    {\n        WriteResponseHandler<?> handler = new WriteResponseHandler<>(replicaPlan,\n                                                                     WriteType.BATCH_LOG,\n                                                                     null,\n                                                                     requestTime);\n\n        Batch batch = Batch.createLocal(uuid, FBUtilities.timestampMicros(), mutations);\n        Message<Batch> message = Message.out(BATCH_STORE_REQ, batch);\n        for (Replica replica : replicaPlan.liveAndDown())\n        {\n            if (logger.isTraceEnabled())\n                logger.trace(\"Sending batchlog store request {} to {} for {} mutations\", batch.id, replica, batch.size());\n","sourceCodeStart":1622,"sourceCodeEnd":1658,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/StorageProxy.java#L1622-L1658","documentation":"After completing a write, StorageProxy updates the coordinatorWriteLatency latency metric. Any exception thrown while recording that metric (timing, histogram registration, etc.) is caught and logged at warn level — the write itself already succeeded, so this only indicates a metrics-infrastructure problem, not data loss.","triggerScenarios":"An Exception escapes the metric update code in the write-completion path (e.g. during coordinatorWriteLatency latency recording), caught by the catch block that logs this message with the stack trace as the argument.","commonSituations":"Metrics library (Dropwizard) issues; unexpected nulls or races in the latency-recording path; usually seen in logs alongside JMX/metrics registry problems.","solutions":["Read the attached exception stack trace in the log to identify the actual cause","Verify the metrics registry/JMX reporting configuration is valid","Upgrade to a version where the specific metrics bug (if any) is fixed — include the stack trace in a report if reproducible","Confirm writes are succeeding (check write latency/throughput metrics); this warning alone does not affect data"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// the library already catches it; treat as noisy-log signal only\nif (logsContain(\"Exception occurred updating coordinatorWriteLatency metric\"))\n    alertOnMetricsPipeline(); // investigate metrics/JMX infra, not writes","preventionTips":["Keep Dropwizard/JMX registry configuration valid and tested","Alert on this log pattern to catch metrics-infrastructure regressions early","Confirm write SLOs independently of metric recording"],"tags":["metrics","latency","logging"],"backgroundTag":"internal-invariant-violation","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"}