{"record":{"id":"c37a7c3373a3fe36","repo":"apache/flink","slug":"job-s-is-in-state-suspended","errorCode":null,"errorMessage":"Job %s is in state SUSPENDED","messagePattern":"Job (.+?) is in state SUSPENDED","errorType":"exception","errorClass":"JobStateUnknownException","httpStatus":null,"severity":"warning","filePath":"flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java","lineNumber":1005,"sourceCode":"            return \"Unknown address.\";\n        }\n    }\n\n    // -------------------------------------------------------------------------\n    // RestClient Helper\n    // -------------------------------------------------------------------------\n\n    private CompletableFuture<JobStatus> requestJobStatus(JobID jobId) {\n        final JobStatusInfoHeaders jobStatusInfoHeaders = JobStatusInfoHeaders.getInstance();\n        final JobMessageParameters params = new JobMessageParameters();\n        params.jobPathParameter.resolve(jobId);\n\n        return sendRequest(jobStatusInfoHeaders, params)\n                .thenApply(JobStatusInfo::getJobStatus)\n                .thenApply(\n                        jobStatus -> {\n                            if (jobStatus == JobStatus.SUSPENDED) {\n                                throw new JobStateUnknownException(\n                                        String.format(\"Job %s is in state SUSPENDED\", jobId));\n                            }\n                            return jobStatus;\n                        });\n    }\n\n    private static class JobStateUnknownException extends RuntimeException {\n        public JobStateUnknownException(String message) {\n            super(message);\n        }\n    }\n\n    private CompletableFuture<JobResult> requestJobResultInternal(@Nonnull JobID jobId) {\n        return pollResourceAsync(\n                        () -> {\n                            final JobMessageParameters messageParameters =\n                                    new JobMessageParameters();\n                            messageParameters.jobPathParameter.resolve(jobId);","sourceCodeStart":987,"sourceCodeEnd":1023,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java#L987-L1023","documentation":"Thrown as a JobStateUnknownException when requestJobStatus polls the REST /jobs/:jobid/status endpoint and the job is in JobStatus.SUSPENDED. A SUSPENDED job is one that was running but has been removed from the scheduler due to a failure (e.g., JobManager restart without recovery, or manual suspension). The client treats SUSPENDED as an unknown terminal state because the job is neither running nor cleanly finished.","triggerScenarios":"Polling job status via getJobStatus(jobId) when the job has been suspended — typically after a JobManager failover where the job could not be recovered, or when a job is manually suspended via the REST API.","commonSituations":"JobManager restarted from a checkpoint/savepoint but the job was not configured for HA recovery; job exceeded the restart strategy limit and was suspended; manual suspension via REST PATCH /jobs/:jobid; concurrent job cancellation from another client.","solutions":["Check the JobManager logs for why the job entered SUSPENDED state (restart strategy exhausted, resource unavailable).","If HA was not enabled, configure high-availability mode so the job can recover from JM failover.","Increase the restart strategy limits (restart-strategy.fixed-delay.attempts) if the job failed due to transient errors.","Restart the job from the latest savepoint or checkpoint."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    JobStatus status = client.getJobStatus(jobId).get();\n} catch (ExecutionException e) {\n    Throwable cause = ExceptionUtils.stripExecutionException(e);\n    if (cause instanceof RestClusterClient.JobStateUnknownException) {\n        // job is SUSPENDED — may need to restart from savepoint\n        log.warn(\"Job {} is suspended, attempting recovery from savepoint\", jobId);\n    }\n}","preventionTips":["Enable HA mode so jobs survive JobManager failover.","Configure an adequate restart strategy.","Take periodic savepoints for recovery."],"tags":["job-status","rest-client","suspended","recovery"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}