Skip to content

GH-5280: Include job execution details in JobExecutionAlreadyRunningException#5424

Open
won-seoop wants to merge 1 commit into
spring-projects:mainfrom
won-seoop:fix-5280-job-execution-already-running-message
Open

GH-5280: Include job execution details in JobExecutionAlreadyRunningException#5424
won-seoop wants to merge 1 commit into
spring-projects:mainfrom
won-seoop:fix-5280-job-execution-already-running-message

Conversation

@won-seoop

Copy link
Copy Markdown
Contributor

Summary

Fixes #5280.

When TaskExecutorJobLauncher detects that a job execution is already running, it throws JobExecutionAlreadyRunningException. Previously the exception message included the JobInstance details:

A job execution for this job is already running: JobExecution: id=1, version=null, startTime=..., status=STARTED, ...
job=[JobInstance: id=1, version=null, Job=[job]], jobParameters=[...]

Wait, no. The old message was:

A job execution for this job is already running: JobInstance: id=1, version=null, Job=[job]

This only shows the job instance details (name and parameters), not which execution is running. Switching to the running execution object makes the message immediately useful, showing the execution id, start time, status, and other execution-level details.

Before:

JobExecutionAlreadyRunningException: A job execution for this job is already running: JobInstance: id=1, version=null, Job=[job]

After:

JobExecutionAlreadyRunningException: A job execution for this job is already running: JobExecution: id=1, version=null, startTime=..., endTime=null, lastUpdated=..., status=STARTED, ...

Test plan

  • No existing tests assert the specific exception message text.
  • TaskExecutorJobLauncherTests and JobRestartIntegrationTests continue to pass.

🤖 Generated with Claude Code

…AlreadyRunningException

The exception message previously included the JobInstance details (which
identifies the job by name and parameters), while the exception type
and its description clearly indicate that a specific *execution* is
already running. Replacing `jobInstance` with `execution` in the message
makes the output immediately actionable: it now shows the execution id,
status, start time, and other execution-level attributes instead of
repeating instance-level information that is already clear from context.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inaccurate exception message when attempting to start a running job

1 participant