# Undersized thread pool + AbortPolicy: 3 of 4 partitions rejected, and stuck forever $ java -jar target/spring-batch-partitioning-1.0.0.jar --spring.profiles.active=reject \ --partition.shards-dir=./data/shards-small --partition.grid-size=4 --partition.reject.pool-size=1 2026-09-14T09:11:18.181Z INFO 3074 --- [ main] c.a.b.PartitioningDemoApplication : The following 1 profile is active: "reject" 2026-09-14T09:11:21.361Z INFO 3074 --- [ main] o.s.batch.core.step.AbstractStep : Executing step: [ordersManagerStep] 2026-09-14T09:11:21.375Z INFO 3074 --- [der-partition-1] o.s.batch.core.step.AbstractStep : Executing step: [ordersWorkerStep:partition1] 2026-09-14T09:11:21.946Z INFO 3074 --- [der-partition-1] o.s.batch.core.step.AbstractStep : Step: [ordersWorkerStep:partition1] executed in 570ms org.springframework.batch.core.job.JobExecutionException: Partition handler returned an unsuccessful step 2026-09-14T09:11:21.961Z INFO 3074 --- [ main] o.s.batch.core.step.AbstractStep : Step: [ordersManagerStep] executed in 601ms JOB FINISHED: id=1 status=FAILED exitCode=FAILED Only ordersWorkerStep:partition1 ever logs "Executing step" -- the other three were rejected by the ThreadPoolTaskExecutor (corePoolSize=1, queueCapacity=0, AbortPolicy) before they could even start, and TaskExecutorPartitionHandler swallows that TaskRejectedException into the rejected StepExecution's failure list rather than printing it -- nothing named "TaskRejectedException" or "Rejected" ever appears in this log. The job fails with the generic message above. --- Querying BATCH_STEP_EXECUTION directly (org.h2.tools.Shell) shows what the log does not --- $ java -cp h2-2.4.240.jar org.h2.tools.Shell -url jdbc:h2:file:./data/rejecttest -user sa -password "" \ -sql "SELECT STEP_EXECUTION_ID, STEP_NAME, STATUS, EXIT_CODE FROM BATCH_STEP_EXECUTION ORDER BY STEP_EXECUTION_ID;" STEP_EXECUTION_ID | STEP_NAME | STATUS | EXIT_CODE 1 | ordersManagerStep | FAILED | FAILED 2 | ordersWorkerStep:partition3 | STARTING | EXECUTING 3 | ordersWorkerStep:partition2 | STARTING | EXECUTING 4 | ordersWorkerStep:partition1 | COMPLETED | COMPLETED 5 | ordersWorkerStep:partition0 | STARTING | EXECUTING The manager step and the job both reach FAILED. The three rejected worker StepExecutions do not -- they are parked at STARTING/EXECUTING permanently. Nothing in this job's lifecycle ever transitions them again on its own.