Skip to content

Suspend - #43

Merged
et-nik merged 2 commits into
masterfrom
0926-suspend
Oct 15, 2026
Merged

et-nik merged 2 commits into
masterfrom
0926-suspend

Conversation

@et-nik

@et-nik et-nik commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Suspended servers are not started or restarted by direct commands or scheduled tasks. Scheduled start, restart, update, and reinstall tasks are skipped, while scheduled stops remain available.
    • Installations and updates leave suspended servers stopped.
    • If a suspended server is detected running, the system attempts to stop it after a 30-second grace period and retries no more than once per minute.
  • Documentation
    • Added guidance on suspended-server behavior, including the grace period before stopping a running server.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: ae5e46f9-0f1b-4119-b6cf-b0c907a22400
📥 Commits

Reviewing files that changed from the base of the PR and between cabc8a5 and e843d9a.

⛔ Files ignored due to path filters: 1
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing: 2
  • .github/workflows/test.yml
  • go.mod
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

📝 Walkthrough

The change adds suspension checks across server autostart, start and restart commands, post-install startup, scheduled tasks, and the server loop. The loop now stops suspended servers that remain running after a grace period. The test workflow and selected Go dependency versions are also updated.

Changes: Suspended server handling

Layer / File(s) Summary
Suspension state and autostart
internal/app/domain/server.go, internal/app/domain/server_autostart_test.go
The domain exposes ErrServerBlocked and Server.IsSuspended. CanAutoStart now checks suspension, and tests cover suspension state updates from panel pushes.
Start and restart command guards
internal/app/game_server_commands/commands.go, internal/app/game_server_commands/start_server.go, internal/app/game_server_commands/restart_server.go, internal/app/game_server_commands/start_server_test.go, internal/app/game_server_commands/suspended_server_test.go, test/functional/game_server_suite.go, test/functional/serverscommand/{start,restart}/*
Start and restart commands refuse suspended servers and record the refusal in command output and results. Tests cover suspended and unsuspended execution.
Post-install start guard
internal/app/game_server_commands/install_server.go, internal/app/game_server_commands/install_server_test.go
Installation or updating does not restart a server if it is suspended. Tests cover active and suspended server states.
Scheduled command policy
internal/app/servers_scheduler/{execution.go,policy.go,helpers_test.go,scheduler_suspended_test.go}
The scheduler skips suspended-server start, restart, update, install, and reinstall commands before loading them. Scheduled stop commands remain permitted.
Stopping suspended servers found running
internal/app/servers_loop/{loop.go,loop_test.go}, internal/processmanager/README.md
The loop tracks suspended servers found running, waits through a grace period, then runs stop commands asynchronously with a retry interval. Tests cover timing, retries, and command locks. The README documents this behavior.

Toolchain updates

Layer / File(s) Summary
Workflow and Go dependency versions
.github/workflows/test.yml, go.mod
The golangci-lint workflow version, Go directive, and selected indirect dependency versions are updated.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant ServersLoop
  participant CommandLoader
  participant StopCommand
  ServersLoop->>ServersLoop: Track a suspended server found running
  ServersLoop->>CommandLoader: Load the stop command after the grace period
  CommandLoader-->>ServersLoop: Return the stop command
  ServersLoop->>StopCommand: Execute with a timeout
  StopCommand-->>ServersLoop: Return result and output
Loading
Merge Risk: 🔵 Low · up to e843d

A narrow timing window can stop a server shortly after it is unsuspended, potentially leaving it offline until restarted. Synchronizing suspension updates and the stop would prevent this; the impact is limited to the affected server.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 28.21% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 39 functions across 18 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title identifies the main suspension feature. It is concise but broad and does not describe the affected server commands or daemon behavior.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 28.21% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 39 functions across 18 files. (2 skipped: 2 unsupported.)

  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 38656293719

Coverage increased (+0.5%) to 48.501%

Details

  • Coverage increased (+0.5%) from the base build.
  • Patch coverage: 18 uncovered changes across 2 files (97 of 115 lines covered, 84.35%).
  • No coverage regressions found.

Uncovered Changes

File Changed Covered %
internal/app/servers_loop/loop.go 71 55 77.46%
internal/app/game_server_commands/restart_server.go 14 12 85.71%
Total (7 files) 115 97 84.35%

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 12707
Covered Lines: 6163
Line Coverage: 48.5%
Coverage Strength: 10270.58 hits per line

💛 - Coveralls

@et-nik
et-nik merged commit 42e71f9 into master Oct 15, 2026
7 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