Skip to content

refactor: Newt runtime lifecycle to context-driven worker supervision.#300

Draft
LaurenceJJones wants to merge 2 commits intofosrl:devfrom
LaurenceJJones:refactor/context-errgroup
Draft

refactor: Newt runtime lifecycle to context-driven worker supervision.#300
LaurenceJJones wants to merge 2 commits intofosrl:devfrom
LaurenceJJones:refactor/context-errgroup

Conversation

@LaurenceJJones
Copy link
Copy Markdown
Member

@LaurenceJJones LaurenceJJones commented Apr 7, 2026

Community Contribution License Agreement

By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.

Description

Replace stop-channel orchestration with scoped context cancellation for tunnel and interval workers, add errgroup-based supervision for long-running services, and simplify shutdown to fail fast so Docker/systemd handles restarts.

also will help #24 as we dont return after interval we keep going to max interval ceiling, we should maybe also add flags or env that if we reach max interval to just kill process as we dont know if we need a new state to revive.

How to test?

Pure internal refactor.

Replace stop-channel orchestration with scoped context cancellation for tunnel and interval workers, add errgroup-based supervision for long-running services, and simplify shutdown to fail fast so Docker/systemd handles restarts.
// startAuthDaemon initializes and starts the auth daemon.
// It validates requirements (Linux, root, preshared key) and runs the server
// until the provided context is cancelled.
func startAuthDaemon(ctx context.Context) error {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will check if code is reused in pangolin cli as this may break as the function doesnt automatically run in a go routine now.

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.

1 participant