[PR #300] refactor: Newt runtime lifecycle to context-driven worker supervision. #2260

Open
opened 2026-05-03 05:58:29 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fosrl/newt/pull/300
Author: @LaurenceJJones
Created: 4/7/2026
Status: 🔄 Open

Base: devHead: refactor/context-errgroup


📝 Commits (2)

  • f43e11f Refactor Newt runtime lifecycle to context-driven worker supervision.
  • b7b7a90 fix: dont throw away timers reuse them for gc

📊 Changes

4 files changed (+190 additions, -123 deletions)

View changed files

📝 authdaemon.go (+8 -12)
📝 common.go (+26 -30)
📝 main.go (+97 -65)
📝 websocket/client.go (+59 -16)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fosrl/newt/pull/300 **Author:** [@LaurenceJJones](https://github.com/LaurenceJJones) **Created:** 4/7/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `refactor/context-errgroup` --- ### 📝 Commits (2) - [`f43e11f`](https://github.com/fosrl/newt/commit/f43e11f7e103d1282be002132b4fc1b376ff051b) Refactor Newt runtime lifecycle to context-driven worker supervision. - [`b7b7a90`](https://github.com/fosrl/newt/commit/b7b7a90e51db46022cbd21501beadd4d816ce33c) fix: dont throw away timers reuse them for gc ### 📊 Changes **4 files changed** (+190 additions, -123 deletions) <details> <summary>View changed files</summary> 📝 `authdaemon.go` (+8 -12) 📝 `common.go` (+26 -30) 📝 `main.go` (+97 -65) 📝 `websocket/client.go` (+59 -16) </details> ### 📄 Description ## 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-03 05:58:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/newt#2260