cdc may be stuck in logpuller PriorityQueue
@wk989898 is already working on this.
Since Mar 30, 2026.
- Dominant language
- Go
- Stars
- 56
- Forks
- 63
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 34
Description
PriorityQueue.Pop() will block and wait for pq.signal when called on an empty queue, but PriorityQueue.Close() only clears the heap and does not close or notify pq.signal. So if a goroutine is currently calling Pop() on an empty queue, it will not be awakened by Close(). Then this waiting party is not fake; it is a real consumer in the main chain: subscriptionClient.handleRegions() will loop and call s.regionTaskQueue.Pop(ctx). The ctx it passes in is the ctx derived from errgroup in Run(), not subscriptionClient's own s.ctx. So the key point is: although subscriptionClient.Close() will do s.cancel() and s.regionTaskQueue.Close(), if the outer Run()'s errgroup ctx hasn't been canceled yet, handleRegions() might continue to get stuck on Pop(ctx). The final manifestation is that shutdown doesn't complete cleanly, and Run() might hang.
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.
Assessment
This issue has not been assessed yet.