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

[MRESOLVER-521] Improve congested file locks behaviour #455

Merged

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Apr 2, 2024

Instead to immediately give up and sleep, they will sit a while to enter critical region. This is important for "hot" locks.

Explanation: currently a "loser" will immediately give up and will go to sleep 100ms if cannot enter critical region, even if winner exits critical region within next 5ms. The retry is needed to ensure that it is retried as much as given time/unit takes, that was before consumed by constant retries+sleeps. The logic still works, as if tryLock spends time/unit waiting on criticalRegion (which is possible only on VERY HIGHLY congested locks), there will be no retry happening.


https://issues.apache.org/jira/browse/MRESOLVER-521

Instead to immediately give up and sleep, they will
sit a while to enter critical region. This is important
for "hot" locks.
@cstamas cstamas self-assigned this Apr 2, 2024
@cstamas cstamas requested a review from gnodet April 2, 2024 11:47
@cstamas cstamas changed the title Improve congested file locks behaviour [MRESOLVER-521] Improve congested file locks behaviour Apr 2, 2024
@cstamas cstamas marked this pull request as ready for review April 2, 2024 12:21
@cstamas cstamas merged commit 089796b into apache:master Apr 3, 2024
4 checks passed
@cstamas cstamas deleted the improve-fs-locks-congestion-handling branch April 3, 2024 11:38
cstamas added a commit to cstamas/maven-resolver that referenced this pull request Apr 10, 2024
Instead to immediately give up and sleep, they will sit a while to enter critical region. This is important for "hot" locks.

Explanation: currently a "loser" will _immediately give up_ and will go to sleep 100ms if cannot enter critical region, even if winner exits critical region within next 5ms. The retry is needed to ensure that it is retried as much as given time/unit takes, that was before consumed by constant retries+sleeps. The logic still works, as if tryLock spends time/unit waiting on criticalRegion (which is possible only on VERY HIGHLY congested locks), there will be no retry happening.

---

https://issues.apache.org/jira/browse/MRESOLVER-522
cstamas added a commit that referenced this pull request Apr 10, 2024
Instead to immediately give up and sleep, they will sit a while to enter critical region. This is important for "hot" locks.

Explanation: currently a "loser" will _immediately give up_ and will go to sleep 100ms if cannot enter critical region, even if winner exits critical region within next 5ms. The retry is needed to ensure that it is retried as much as given time/unit takes, that was before consumed by constant retries+sleeps. The logic still works, as if tryLock spends time/unit waiting on criticalRegion (which is possible only on VERY HIGHLY congested locks), there will be no retry happening.

Backport of 089796b

---

https://issues.apache.org/jira/browse/MRESOLVER-522
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants