Skip to content

Conversation

@dpkp
Copy link
Owner

@dpkp dpkp commented May 14, 2025

Both lookup_coordinator and _send_heartbeat_request make client api calls that require locking. The tricky part of the heartbeat run loop is that we need to always acquire client lock first and coordinator lock second (to avoid deadlocks), but we also cannot hold the client lock while calling coordinator lock.wait() . To make this easier, switch from context managers to try / finally and catch any RuntimeError if the client lock has already been released when we reach the finally block.

@dpkp dpkp merged commit 8a424e9 into master May 15, 2025
33 of 34 checks passed
@dpkp dpkp deleted the dpkp/heartbeat-thread-locks branch May 15, 2025 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants