{"record":{"id":"c165e916aad01051","repo":"quarkusio/quarkus","slug":"could-not-evaluate-standby-mode","errorCode":null,"errorMessage":"Could not evaluate standby mode","messagePattern":"Could not evaluate standby mode","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"warning","filePath":"extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java","lineNumber":459,"sourceCode":"            QuartzTrigger trigger = scheduledTasks.get(parsedIdentity);\n            if (trigger != null) {\n                scheduler.resumeJob(new JobKey(SchedulerUtils.lookUpPropertyValue(parsedIdentity), Scheduler.class.getName()));\n                events.fireScheduledJobResumed(new ScheduledJobResumed(trigger));\n            }\n        } catch (SchedulerException e) {\n            throw new RuntimeException(\"Unable to resume job\", e);\n        }\n    }\n\n    @Override\n    public boolean isRunning() {\n        if (!isStarted()) {\n            return false;\n        } else {\n            try {\n                return !scheduler.isInStandbyMode();\n            } catch (SchedulerException e) {\n                throw new IllegalStateException(\"Could not evaluate standby mode\", e);\n            }\n        }\n    }\n\n    @Override\n    public List<Trigger> getScheduledJobs() {\n        if (!isStarted()) {\n            throw notStarted();\n        }\n        return List.copyOf(scheduledTasks.values());\n    }\n\n    @Override\n    public Trigger getScheduledJob(String identity) {\n        if (!isStarted()) {\n            throw notStarted();\n        }\n        Objects.requireNonNull(identity);","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/quartz/runtime/src/main/java/io/quarkus/quartz/runtime/QuartzSchedulerImpl.java#L441-L477","documentation":"Quarkus throws this IllegalStateException when querying the underlying Quartz scheduler's standby state fails. Scheduler.isRunning() returns !scheduler.isInStandbyMode(); Quartz raises SchedulerException if the scheduler is shut down or its JobStore cannot be consulted, and Quarkus converts it into this unchecked exception.","triggerScenarios":"Calling Scheduler.isRunning() after the Quartz scheduler has been shut down (or is shutting down) or when the underlying store cannot answer isInStandbyMode() — e.g. during shutdown races or JDBC store failures.","commonSituations":"Calling isRunning() from a shutdown hook or Scheduled job executing during app shutdown; health checks racing the destroy() lifecycle; DB-backed store failing mid-query.","solutions":["Guard with isStarted() and check shutdown state before calling isRunning()","Avoid calling isRunning() during application shutdown callbacks","Check the cause SchedulerException for a store-level failure and fix datasource connectivity","Use isStarted() (scheduler exists) rather than isRunning() when you only need lifecycle existence"],"exampleFix":"// before\nboolean running = scheduler.isRunning();\n// after\nboolean running = scheduler.isStarted() && !isShuttingDown() ? safeIsRunning(scheduler) : false;\n\nboolean safeIsRunning(Scheduler s) {\n    try { return s.isRunning(); }\n    catch (IllegalStateException e) { return false; }\n}","handlingStrategy":"type-guard","validationCode":"boolean safe = scheduler.isStarted();\n// check scheduler state before calling isRunning()","typeGuard":"boolean isRunningSafe(io.quarkus.scheduler.Scheduler s) {\n    if (s == null || !s.isStarted()) return false;\n    try { return s.isRunning(); }\n    catch (IllegalStateException e) { return false; }\n}","tryCatchPattern":"try {\n    boolean running = scheduler.isRunning();\n} catch (IllegalStateException e) {\n    boolean running = false; // treat as not-running during shutdown\n}","preventionTips":["Avoid calling isRunning() inside shutdown hooks / @PreDestroy logic","Use isStarted() when you only need to know if a scheduler exists","Cache the running state instead of polling during shutdown"],"tags":["quartz","scheduler","standby","lifecycle"],"backgroundTag":"scheduler-shutdown-race","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}