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

LockManager lock should work atomically #3251

Open
fomich-artem opened this issue Dec 14, 2021 · 0 comments
Open

LockManager lock should work atomically #3251

fomich-artem opened this issue Dec 14, 2021 · 0 comments

Comments

@fomich-artem
Copy link

Environment

General issue

Description of the bug

Method com.haulmont.cuba.core.app.LockManager#lock(java.lang.String, java.lang.String) has atomicity problem - between getting value from a map and putting them to it. I think is need to be used method "putIfAbsent" instead of "get" and "put" for example. In addition, if you look at the problem more deeply, then the question also arises of how to solve this in a clustered environment.

See:

public LockInfo lock(String name, String id) {

Sorry for my english!

@knstvk knstvk changed the title LockManager lock should be works atomically LockManager lock should work atomically Dec 17, 2021
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

No branches or pull requests

1 participant