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 #274

Closed
fomich-artem opened this issue Dec 15, 2021 · 0 comments · Fixed by #3768
Closed

LockManager lock should work atomically #274

fomich-artem opened this issue Dec 15, 2021 · 0 comments · Fixed by #3768
Assignees
Milestone

Comments

@fomich-artem
Copy link

A copy-paste of cuba-platform/cuba#3251

Environment

General issue

Description of the bug

Method io.jmix.core.pessimisticlocking.impl.LockManagerImpl#lock(java.lang.String, java.lang.String) has atomicity problem - between getting value from a cache 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: https://github.com/Haulmont/jmix-core/blob/10a21a27c5dc9698a88917585029ad1fedf807f7/core/src/main/java/io/jmix/core/pessimisticlocking/impl/LockManagerImpl.java#L127

@gorbunkov gorbunkov changed the title LockManager lock should be works atomically LockManager lock should work atomically Apr 14, 2022
@github-project-automation github-project-automation bot moved this to Backlog in Release 2.3 May 3, 2024
@glebfox glebfox removed this from Release 2.3 Sep 20, 2024
@glebfox glebfox moved this to Next in Release 2.4 Oct 2, 2024
@Gavrilov-Ivan Gavrilov-Ivan moved this from Next to In progress in Release 2.4 Oct 9, 2024
@Gavrilov-Ivan Gavrilov-Ivan linked a pull request Oct 10, 2024 that will close this issue
@github-project-automation github-project-automation bot moved this from In progress to Done in Release 2.4 Oct 10, 2024
@Gavrilov-Ivan Gavrilov-Ivan added this to the 2.4.0 milestone Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants