Skip to content

JobSink mixes the step transaction context with the batch2 state machine. #8208

Description

@michaelabuckley

@../hapi-fhir/hapi-fhir-storage-batch2/src/main/java/ca/uhn/fhir/batch2/coordinator/JobDataSink.java line 100, the call to enqueueWorkChunkForProcessing does not establish a new transaction like we do on line 95 for the creation call. Since we share the same connection pool between HAPI and Batch2, the Spring transaction manager will use an existing transaction. If the step is in the middle of a tx when it sinks the child chunk, the state update of the chunk will be delayed until the step tx commits. That could be after the child chunk has been delivered to a worker.

The fix is to use a new tx, like we do on line 95.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions