{"record":{"id":"fa7003cf64e44381","repo":"apache/druid","slug":"shutting-down-catalog-sync-with-d-unsent-notifica","errorCode":null,"errorMessage":"Shutting down Catalog sync with %d unsent notifications","messagePattern":"Shutting down Catalog sync with (.+?) unsent notifications","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CacheNotifier.java","lineNumber":118,"sourceCode":"\n  @VisibleForTesting\n  public void stopGracefully()\n  {\n    try {\n      while (!updates.isEmpty()) {\n        Threads.sleepFor(100, TimeUnit.MILLISECONDS);\n      }\n    }\n    catch (InterruptedException e) {\n      // Ignore\n    }\n    stop();\n  }\n\n  public void stop()\n  {\n    if (!updates.isEmpty()) {\n      LOG.warn(\"Shutting down Catalog sync with %d unsent notifications\", updates.size());\n    }\n    exec.shutdownNow();\n    LOG.info(\"Catalog sync stopped\");\n  }\n}\n","sourceCodeStart":100,"sourceCodeEnd":124,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/druid-catalog/src/main/java/org/apache/druid/catalog/sync/CacheNotifier.java#L100-L124","documentation":"CacheNotifier.stop() logs a warning when the Catalog sync executor is shut down while its in-memory 'updates' queue still holds notifications that were never delivered. The queued table/property change notifications are discarded by shutdownNow(), so subscribers may miss updates. This is a lifecycle diagnostics warning, not an exception.","triggerScenarios":"Calling stop() (directly or via stopGracefully/Lifecycle.stop) while notification tasks are still pending in the updates queue; broker or coordinator shutdown while catalogs are being updated faster than notifications are drained.","commonSituations":"Druid process shutdown under heavy catalog churn; misconfigured short sync intervals combined with slow consumers; failing fast during startup teardown after a failed lifecycle init.","solutions":["No action needed for the warning itself; it only indicates potentially lost notifications — dependent caches will resync on their next periodic resync().","If frequent, increase the notification queue drain rate (check executor configuration) or reduce catalog update frequency.","Ensure a clean shutdown path: call stop() only after consumers have caught up (graceful lifecycle ordering).","Verify affected caches via resync after restart to repair any missed notifications."],"exampleFix":"// before\nnotifier.stop(); // warning: unsent notifications\n// after\ncatalogReceiver.resync(); // after stop/restart, force full resync to recover dropped notifications","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat notifications as best-effort and always resync() after restart.","Keep the updates queue drained; monitor its size in metrics.","Shut down sync receivers before producers during lifecycle teardown."],"tags":["shutdown","queue-drop","lifecycle","cache-sync"],"backgroundTag":"invalid-state-transition","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}