Open adrianriley opened 3 years ago
BATCH_JOB_EXECUTION.STATUS
should not be null
. It starts with STARTING and is updated to other non null values during the job execution. Unless updated manually to null
in the database (which is not supposed to be done), I don't see where it could be set to null
in the code. So before fixing the bug in any UI, I would like to see the circumstances under which this column ends up being null
. Can you please share more details about how/when this happens?
Sorry, I can't see how it happened either. I've seen one instance from some months ago, but it's only just come to light by implementing use of findRunningJobExecutions()
. Logging of the execution which created the row in the SCDF logs is minimal, so my guess is that it was created by running the application outside of the SCDF server, using the same DB. As you say, the initial creation of the row should have status STARTING
and I don't see how it can ever be set to null using code in the spring batch libs.
So maybe it's a non-issue. But the DB column is nullable so defensively perhaps the code shouldn't assume values are not null.
Bug description BATCH_JOB_EXECUTION.STATUS may be null. If it is, a NullPointerException is thrown by JdbcJobExecutionDao.JobExecutionRowMapper.mapRow, See this line:
jobExecution.setStatus(BatchStatus.valueOf(rs.getString(4)));
Environment spring-batch-core 4.2.1.RELEASE. But the bug still appears to be there in 5.0.0-SNAPSHOT
Steps to reproduce Actually happened calling JdbcJobExecutionDao.findRunningJobExecutions(), but you can see it on the UI. Pick an instance. Update BATCH_JOB_EXECUTION.STATUS to null. Try to view it on .../dashboard/#/tasks-jobs/task-executions/nnnn
Expected behavior I'd expect status to be blank. Not a NullPointerException.
Minimal Complete Reproducible example