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

[1.9.x] [MRESOLVER-522] Improve congested file locks behaviour (#455) #461

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented 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

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 cstamas self-assigned this Apr 10, 2024
@cstamas cstamas changed the title [MRESOLVER-522] Improve congested file locks behaviour (#455) [1.9.x] [MRESOLVER-522] Improve congested file locks behaviour (#455) Apr 10, 2024
@cstamas cstamas merged commit b225076 into apache:maven-resolver-1.9.x Apr 10, 2024
10 checks passed
@cstamas cstamas deleted the MRESOLVER-522 branch April 10, 2024 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant