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

Remove timeout locks #6048

Merged
merged 4 commits into from
Jul 26, 2024
Merged

Remove timeout locks #6048

merged 4 commits into from
Jul 26, 2024

Conversation

dapplion
Copy link
Collaborator

@dapplion dapplion commented Jul 4, 2024

Issue Addressed

Chatting with @michaelsproul he noted that locks with timeouts can kill liveness, and do more harm than good. If an operation takes more than the timeout to acquire the lock, erroring causes that operation to be retried and fail again.

I recall that timeouts helped in the past with deadlocks. Looks like this thread is well mitigated now?

Proposed Changes

Replace these three timeout rw locks with rw locks

pub const ATTESTATION_CACHE_LOCK_TIMEOUT: Duration = Duration::from_secs(1);
pub const VALIDATOR_PUBKEY_CACHE_LOCK_TIMEOUT: Duration = Duration::from_secs(1);
pub const ETH1_FINALIZATION_CACHE_LOCK_TIMEOUT: Duration = Duration::from_millis(200);

@dapplion dapplion added the ready-for-review The code is ready for review label Jul 4, 2024
@michaelsproul
Copy link
Member

We should also hide and deprecate the disable-lock-timeouts flag when removing these

I was going to block the removal of the timeouts on adding deadlock detection, but it seems like getting lockbud to run could be quite involved:

https://github.com/BurtonQin/lockbud

It depends on Rust Nightly, so it will need to be continually updated as we increase our MSRV, and might break in surprising ways (my experience with writing lints pinned to nightly)

@dapplion dapplion added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-review The code is ready for review labels Jul 10, 2024
@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jul 25, 2024
@michaelsproul
Copy link
Member

@dapplion a few CI failures to fix

@michaelsproul michaelsproul added waiting-on-author The reviewer has suggested changes and awaits thier implementation. and removed ready-for-merge This PR is ready to merge. labels Jul 25, 2024
@dapplion dapplion added ready-for-review The code is ready for review and removed waiting-on-author The reviewer has suggested changes and awaits thier implementation. labels Jul 25, 2024
@michaelsproul
Copy link
Member

@mergify queue

Copy link

mergify bot commented Jul 26, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at b949db0

@michaelsproul michaelsproul added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review labels Jul 26, 2024
mergify bot added a commit that referenced this pull request Jul 26, 2024
@mergify mergify bot merged commit b949db0 into sigp:unstable Jul 26, 2024
29 checks passed
@dapplion dapplion deleted the pk-cache-timeout branch July 28, 2024 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge This PR is ready to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants