Skip to content

Conversation

@plebhash
Copy link
Member

@plebhash plebhash commented Jan 29, 2026

close #215

in this PR we:

  • remove ShutdownMessage + notify_shutdown: tokio::sync::broadcast (and all the corresponding machinery) from all apps
  • introduce CancellationToken to all apps
  • introduce stratum-apps::fallback_coordinator::FallbackCoordinator to tProxy + JDC

some relevant notes:

  • now client disconnections only pass through the main status loop, without touching shutdown or fallback signaling machinery
  • JDC had some redundant granularity on fallback signals, which were unified into a single FallbackCoordinator
  • now fallback no-longer tries to re-utilize the same components (e.g.: ChannelManager, Sv1Server, MonitoringServer), and instead, we re-initialize all of them... the component initialization routines are currently duplicated for clarity, but happy to modularize them into a single function

a few days ago I framed this as something to be done under the scope of #24

along the way I realized it was better to shape this as a standalone thing, which hopefully can serve as foundation for #24 once merged (together with lots of foundations already established via #132)

}
_ = fallback_token.cancelled() => {
info!("Channel Manager: fallback triggered, resetting state");
self.upstream_state.set(UpstreamState::SoloMining);
Copy link
Member Author

Choose a reason for hiding this comment

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

I vaguely remember reading debates on whether this is the right thing to do or not

I haven't fully analyzed that discussion in depth, so I have no stance on it

this PR aims to be orthogonal to that discussion, so we're simply preserving the same behavior that existed before

@plebhash plebhash force-pushed the 2026-01-27-cancellation-tokens branch from 39e49a9 to 53e33be Compare January 30, 2026 02:12
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.

need to replace tokio::sync::broadcast as the main shutdown notification system

1 participant