spring-projects / spring-projects/spring-batch

Step name is null in logs when scoped

Open
#4,031 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: waiting-for-reporter type: bug
Dominant language
Java
Stars
3k
Forks
2.5k
Avg merge
6d 53m
Merged PRs (30d)
3

Description

https://github.com/spring-projects/spring-batch/blob/e8e3f5da085c6fedad54094b5d410b06f57f1594/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java#L237

I have my step defined as @JobScope, so it's wrapped in a proxy. During debugging at this line, this.getName() returns the name but this.name returns null. So, this log above prints "Encountered an error executing step null ..."

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java around line 237 and compare the scoped proxy behavior of getName() with direct access to name. Done means the error log reports the step name instead of null when the step is defined with @JobScope.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.