Skip to content

Add blocking mode for dagsync#317

Merged
byo merged 1 commit into
mainfrom
dont-scan-while-processing
Jul 7, 2026
Merged

Add blocking mode for dagsync#317
byo merged 1 commit into
mainfrom
dont-scan-while-processing

Conversation

@byo

@byo byo commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

When enabled, dagsync is blocked for a given provider until explicitly unblocked. This is used by the indexer to block synchronization process until ads processing is finished.

@byo
byo force-pushed the dont-scan-while-processing branch from eeb01b2 to b1544fd Compare July 3, 2026 19:21
When enabled, dagsync is blocked for a given provider
until explicitly unblocked. This is used by the indexer
to block synchronization process until ads processing
is finished.
@byo
byo force-pushed the dont-scan-while-processing branch from b1544fd to 76bfde0 Compare July 6, 2026 16:55
@byo
byo marked this pull request as ready for review July 6, 2026 16:58
@byo
byo requested review from gammazero, nymd and willscott July 6, 2026 16:58
Comment thread dagsync/subscriber.go
s.handlersMutex.Lock()
for pid, hnd := range s.handlers {
if now.After(hnd.expires) {
// TODO: Is this safe for handler to be removed?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, if all handlers are removed it's unclear you'd want to keep sync blocked?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's even more to it than just blocking the sync.

I think the only situation where handler could be removed from that map is if there's no ongoing operation - so neither sync nor processing, as the handler keeps essential synchronization primitives - mutexes, pendingMsg, the whole subscriber etc.

A better interface would be something like acquire/release - acquiring for a specific work would block the handler from removal until it is released, and releasing would update the expiration time, if parallel acquire/release are needed then some acquire counter.

@byo
byo merged commit 76bfde0 into main Jul 7, 2026
7 checks passed
@byo
byo deleted the dont-scan-while-processing branch July 7, 2026 13:22
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.

2 participants