Skip to content

Fix TowerJsonGenerator thread-safety issue#6619

Merged
pditommaso merged 1 commit intomasterfrom
fix-tower-json-generator-thread-safety
Nov 28, 2025
Merged

Fix TowerJsonGenerator thread-safety issue#6619
pditommaso merged 1 commit intomasterfrom
fix-tower-json-generator-thread-safety

Conversation

@pditommaso
Copy link
Member

Summary

Fix IndexOutOfBoundsException in TowerJsonGenerator caused by concurrent access to the shared stack field from multiple executor threads.

Problem

When multiple executor threads (e.g., AWSBatch-executor-1, AWSBatch-executor-2) serialize JSON simultaneously using the same TowerJsonGenerator instance, they concurrently modify the shared stack ArrayList. This causes race conditions where one thread's saved position becomes invalid after another thread modifies the stack.

Solution

Add synchronized to the writeObject method to ensure thread-safe access to the shared stack field.

🤖 Generated with Claude Code

Add synchronized to writeObject method to prevent concurrent
modification of the shared stack field when multiple executor
threads serialize JSON simultaneously.

Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@netlify
Copy link

netlify bot commented Nov 28, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 38f09e6
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6929d5dc85bf010008b2447a

@pditommaso pditommaso merged commit 579cd6e into master Nov 28, 2025
24 checks passed
@pditommaso pditommaso deleted the fix-tower-json-generator-thread-safety branch November 28, 2025 17:48
pditommaso added a commit that referenced this pull request Nov 28, 2025
Add synchronized to writeObject method to prevent concurrent
modification of the shared stack field when multiple executor
threads serialize JSON simultaneously.

Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant