Skip to content

fix(cli): use config backend port when stopping on start/restart#127

Merged
duguwanglong merged 1 commit intomainfrom
fix/service-stop-backend-port-from-config
Apr 15, 2026
Merged

fix(cli): use config backend port when stopping on start/restart#127
duguwanglong merged 1 commit intomainfrom
fix/service-stop-backend-port-from-config

Conversation

@xiami762
Copy link
Copy Markdown
Contributor

Summary

When stopping services before start_all / restart_all, the backend port fallback now uses the current CLI ServiceConfig (same as frontend) instead of the static default. This fixes cases where runtime pid records are missing or legacy pid-only.

Changes

  • Add _resolve_stop_ports and _stop_all_locked to centralize stop logic under the service lock.
  • stop_all unchanged in behavior (still uses default defaults when no config).
  • start_all / restart_all pass config so backend stop uses config.backend_port as fallback.

Tests

  • New unit tests for missing pid record and legacy pid-only backend port resolution.

Made with Cursor

…tart

When runtime pid records are missing or legacy-only, start_all and
restart_all now resolve the backend stop port from the current CLI
ServiceConfig instead of the static default.

Extract _resolve_stop_ports and _stop_all_locked for shared stop logic
under the service lock.

Made-with: Cursor
@duguwanglong duguwanglong merged commit d27f36a into main Apr 15, 2026
2 checks passed
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