stacklok / stacklok/toolhive-registry-server
PerformSync has no timeout, a hung sync blocks all sources
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 27
- Forks
- 15
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 16
Description
There is no per-sync context deadline. PerformSync receives only the coordinator's base context, which is only cancelled on shutdown. A hung network call (e.g., an API source or git clone that never times out) will block PerformSync indefinitely. Because the coordinator loop is synchronous, this blocks all other sources from syncing for the duration of the hang.
A configurable per-sync timeout (e.g., sync.syncTimeout) should be applied as a context deadline before calling PerformSync, ensuring the deferred status update always fires within a bounded time. The original context from the coordinator handles the cleanup procedure, so this must also keep working after this fix.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the coordinator loop and the PerformSync call, then trace how the base context is used for synchronization and cleanup. Add the configurable sync.syncTimeout deadline while preserving the original coordinator context for cleanup. Done means a hung source cannot block subsequent syncs indefinitely and the deferred status update still fires within the timeout.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100