Skip to content

fix(update): fall back to foreground daemon restart - #345

Closed
Sthreal wants to merge 1 commit into
Tencent:mainfrom
Sthreal:fix/336-windows-update-restart-fallback
Closed

Sthreal wants to merge 1 commit into
Tencent:mainfrom
Sthreal:fix/336-windows-update-restart-fallback

Conversation

@Sthreal

@Sthreal Sthreal commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #336

What changed

  • Keep the existing detached daemon restart attempt on Windows.
  • If the host Job Object denies CREATE_BREAKAWAY_FROM_JOB, log the failure and retry with bsk daemon start --foreground.
  • Keep the update helper as the foreground daemon's parent until the daemon exits.
  • Update the Windows update regression test to verify the replacement daemon on the original port, then stop it and assert daemon metadata is cleared.
  • Document BSK_AUTO_UPDATE=off and the Windows daemon restart fallback in the README.

Why

The current update path can replace bsk.exe successfully, then fail to start the replacement daemon with:

cannot start an independent Windows daemon;
the host may prohibit Job Object breakaway
os error 5

The old daemon has already exited at that point, so the browser pipeline stays disconnected until the user manually starts the daemon again.

Verification

  • cargo test -p bsk --test windows_update -- --nocapture — 3 passed
  • cargo test -p bsk --lib cli::update — 26 passed
  • cargo test -p bsk --lib daemon — 147 passed / 1 ignored
  • cargo fmt --all -- --check — passed
  • cargo clippy -p bsk --all-targets — passed with pre-existing warnings outside this change

@iuyo5678

Copy link
Copy Markdown
Collaborator

Thank you @Sthreal for fixing and validating the Windows upgrade restart issue!

The issue targeted by this PR has now been addressed in #346 through a unified upgrade approach, including replacing the running version, confirming that the new daemon has taken over, and restoring the old version and service if the upgrade fails. We have also adopted the documentation note here regarding BSK_AUTO_UPDATE=off, and your co-author attribution has been retained in the commits for #346.

Subsequent fixes and validation will be consolidated in #346, so we are closing this PR and marking it as superseded by #346. Thank you for your contribution, and we welcome you to continue participating in the validation and discussion of #346!

@iuyo5678 iuyo5678 closed this Sep 27, 2026
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.

[Bug] Windows auto-update replaces the bsk binary but never restarts the daemon — and leaves no failure log

2 participants