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

fix: Synchronize EDR refresh #1633

Open
wants to merge 18 commits into
base: bugfix/0.7.7
Choose a base branch
from

Conversation

rafaelmag110
Copy link
Contributor

@rafaelmag110 rafaelmag110 commented Oct 17, 2024

WHAT

Introduces a synchronization mechanism with database locks that only allows one request to update an expired token at a time. All other requests wait until the first request updates the token and releases the database.

WHY

To fix the issue described in #1618

FURTHER NOTES

PR to bugfix/0.7.7 first because it's a priority to have that merged.

Closes #1618

@rafaelmag110 rafaelmag110 added the bug Something isn't working label Oct 17, 2024
@rafaelmag110 rafaelmag110 requested review from paullatzelsperger and wolf4ood and removed request for paullatzelsperger October 17, 2024 14:17
import org.junit.jupiter.api.BeforeEach;

@ComponentTest
class InMemoryEdrLockTest extends EndpointDataReferenceLockBaseTest {
Copy link
Contributor

@paullatzelsperger paullatzelsperger Oct 22, 2024

Choose a reason for hiding this comment

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

tests for releaseLock missing. there should be some in the base test class, and specific tests in the in-mem test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@paullatzelsperger
Copy link
Contributor

paullatzelsperger commented Oct 22, 2024

Actually, regarding the inmem lock; if access to the hashmap is atomic, the global lock isn't needed anymore.
We either don't implement any locking in the inmem variant, or we use a concurrent hashmap w rowlevel locks, or a global lock. In sequence of (my personal) preference :)

Copy link

sonarcloud bot commented Oct 22, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Open
Development

Successfully merging this pull request may close these issues.

3 participants