What are the steps to reproduce your problem?
Execute FailedJobListener with a Job ID which doesn't exist.
What is the problem?
Executing of the ExecuteJobsCmd and deleting a Job in parallel with working on a Job.
If the Job was deleted the job transaction rollback and the FailedJoblistener will be called, in the ExecuteJobsCmd.
Since the job is deleted the jobId references to no existing job. In the current version of the FailedjobListener the jobId is used to get the Job from the database.
What would be the expected behavior:
If the job doesn't exist the FailedJobListener does nothing.
Hints (optional):
Add not null check to the execution method:
commandExecutor.execute(new Command<Void>() { public Void execute(CommandContext commandContext) { JobEntity job = commandContext .getJobManager() .findJobById(jobId); if (job == null) { //LOG job doesn't exist return null; } fireHistoricJobFailedEvt(jobId); cmd.execute(commandContext); return null; } });
This is the controller panel for Smart Panels app
- is duplicated by
-
CAM-3830 DecrementJobRetries-Command throws NullPointerException when Job has been removed meanwhile
- Closed