Skip to content

Conversation

manast
Copy link
Contributor

@manast manast commented Aug 17, 2025

Why

This PR aims to provide a new option when instantiating Workers, so that it is possible to use a dedicated thread for lock extension and job stalling detection. The reason for allowing this, is so that we can have a safer lock renewal mechanism even in the cases where the jobs are not respecting the best practice of not keeping the event loop busy for long periods of time.

How

We refactor the lock handling in a separate class "LockManager" and then we add support to this class to run in a separate thread that communicates with the main process. Note that this approach is not a fail proof solution to the issue of jobs that keep the event loop busy, as it could also happen that the communication between the main thread and the lock extension thread stalls and issues related to locks may still happen, however it should reduce the number of cases when this happens.

Additional Notes (Optional)

Any extra info here.

@manast manast requested a review from roggervalf August 17, 2025 12:36
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.

1 participant