stacklok / stacklok/toolhive-registry-server

PerformSync has no timeout, a hung sync blocks all sources

Open
#655 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.