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

fix(icp-rosetta): [FI-1694] add watchdog thread to oversee the sync thread #4317

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fsodre
Copy link
Contributor

@fsodre fsodre commented Mar 11, 2025

This PR introduces an implementation of a watchdog thread that monitors heartbeats from a monitored thread and restarts it when there's no heartbeat during a specified timeout interval.

The watchdog class is used to monitor the background synchronization thread in ICP Rosetta, so any potential deadlock is eventually mitigated within 10 seconds.

The watchdog implementation will later be used for ICRC1 Rosetta as well.

Tests:
Besides unit tests for the watchdog thread itself, I've manually tested this by introducing random delays in the sync thread (not being committed here) and observed the successful restarts.

@fsodre fsodre requested a review from a team as a code owner March 11, 2025 12:55
@github-actions github-actions bot added the fix label Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant