Skip to content

Add per-source retry interval to MultiplexedSource - #68

Merged
sduchesneau merged 4 commits into
developfrom
feature/multiplexed-source-retry-intervals
Sep 18, 2026
Merged

sduchesneau merged 4 commits into
developfrom
feature/multiplexed-source-retry-intervals

Conversation

@sduchesneau

Copy link
Copy Markdown
Contributor

New MultiplexedSourceWithRetryIntervals([]time.Duration) option, indexed like the source factories. A source with an interval is not redialed until that much time has passed since its last connection attempt. Sources without one keep the current behavior (redialed on every 5s pass).

This is for a rescuer or fallback endpoint that is down most of the time and would otherwise be dialed, and fail, every 5s. Used by the relayer's retry_interval source parameter in streamingfast/firehose-core#260.

The reconnect loop delay is now copied into a field at construction so tests can set it per instance instead of writing the package variable.

Lets a rescuer or fallback source that is usually down be redialed
less often than every 5s.
Comment thread multiplexedsource.go
Comment on lines -83 to +100
time.Sleep(sourceReconnectDelay)
time.Sleep(s.reconnectDelay)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This sleep is still hidden. To loop calling the Run() should be the one sleeping. Expose reconnectDelay and use it on the loop...

@sduchesneau
sduchesneau merged commit 663ffa2 into develop Sep 18, 2026
3 checks passed
@sduchesneau
sduchesneau deleted the feature/multiplexed-source-retry-intervals branch September 18, 2026 14:35
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