Skip to content

Replace synchronized with ReentrantLock in saga module#8008

Open
somiljain2006 wants to merge 5 commits intoapache:2.xfrom
somiljain2006:Reentrant-lock-impl
Open

Replace synchronized with ReentrantLock in saga module#8008
somiljain2006 wants to merge 5 commits intoapache:2.xfrom
somiljain2006:Reentrant-lock-impl

Conversation

@somiljain2006
Copy link

@somiljain2006 somiljain2006 commented Mar 4, 2026

Ⅰ. Describe what this PR did

Replace usages of synchronized with ReentrantLock in saga related modules to avoid virtual thread pinning when using JDK 21 virtual threads.

Ⅱ. Does this pull request fix one issue?

Fixes #7173

Ⅲ. Why don't you add test cases (unit test/integration test)?

This PR only replaces synchronized with ReentrantLock for Loom compatibility and does not change business logic. Existing unit tests already cover the affected code paths and pass successfully.

Ⅳ. Describe how to verify it

Run this command - grep -R "synchronized (" saga --include="*.java" | grep src
Expected result: no output.

Ⅴ. Special notes for reviews

N/A

@somiljain2006
Copy link
Author

@slievrly @funky-eyes Can you please review this?

@somiljain2006 somiljain2006 requested a review from funky-eyes March 5, 2026 06:23
@somiljain2006
Copy link
Author

@funky-eyes I have done the required changes. Can you review them?

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.

feature: [loom] replace the usages of synchronized with ReentrantLock at sage module

2 participants