Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use one lock per serialization / deserialization beans to prevent deadlock #872

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

dstepanov
Copy link
Contributor

Fixes #842

@dstepanov dstepanov requested review from graemerocher and yawkat June 20, 2024 09:01
deserBean.initialize(decoderContext);
// Double check locking
if (!deserBean.initialized) {
synchronized (this) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe switch to reentrantlock

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For virtual threads?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls check now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, also makes it more clear that initialize needs a lock.

@graemerocher
Copy link
Contributor

can this target 2.10.x?

@dstepanov dstepanov changed the base branch from 2.11.x to 2.10.x June 20, 2024 09:59
@dstepanov
Copy link
Contributor Author

Sure

@graemerocher graemerocher added the type: bug Something isn't working label Jun 20, 2024
Copy link

@graemerocher graemerocher merged commit bf482c3 into 2.10.x Jun 20, 2024
17 checks passed
@graemerocher graemerocher deleted the sync branch June 20, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Deadlock in SerBean.initialize() - SerBean.java:308
3 participants