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

Prevention against locking of deploy directory scanning #115

Merged
merged 2 commits into from
Jan 14, 2017

Conversation

demsey
Copy link
Contributor

@demsey demsey commented Sep 11, 2016

Synchronizing on this may lead to locking of deploy directory scanning.
This happens when custom QBean implementation also use synchronization on this. Then Q2.checkModified() hangs when that custom QBean is locked on this.
In order to prevent such a case, QBeanSupport should use some special object for synchronization.

To solve this, I have used a new object:
final Object modifyLock = new Object();
I do not understand why the method getPersist() was synchronized but setPersist() was not.
I think that setPersist() sould not be synchronized at all, but I'm not sure.
It is proposal only. So please check it.

Synchronizing on "this" may lead to locking of deploy directory scanning.
This happens when custom QBean implementation also use synchronization on
"this". Then Q2.checkModified() hangs when that custom QBean is locked on
"this".
In order to prevent such a case, QBeanSupport should use some special object
for synchronization.
@ar
Copy link
Member

ar commented Sep 11, 2016

Good catch. Thank you!

@ar
Copy link
Member

ar commented Jan 14, 2017

Sorry @demsey this pull request was left behind - will merge it right away.

@ar ar merged commit fae426f into jpos:master Jan 14, 2017
@demsey demsey deleted the scann-lock branch January 17, 2017 08:44
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.

2 participants