Add blocking mode for dagsync#317
Merged
Merged
Conversation
byo
force-pushed
the
dont-scan-while-processing
branch
from
July 3, 2026 19:21
eeb01b2 to
b1544fd
Compare
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
force-pushed
the
dont-scan-while-processing
branch
from
July 6, 2026 16:55
b1544fd to
76bfde0
Compare
byo
marked this pull request as ready for review
July 6, 2026 16:58
willscott
approved these changes
Jul 6, 2026
| s.handlersMutex.Lock() | ||
| for pid, hnd := range s.handlers { | ||
| if now.After(hnd.expires) { | ||
| // TODO: Is this safe for handler to be removed? |
Member
There was a problem hiding this comment.
yeah, if all handlers are removed it's unclear you'd want to keep sync blocked?
Contributor
Author
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.