mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 21:05:40 +07:00
[GH-ISSUE #2760] Second server start should fail fast: PID lock before model loading #1104
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#1104
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ver9118-droid on GitHub (Oct 16, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2760
Problem
Starting a second Strata server on the same port does not fail fast.
main()checks the port (Server((host, port), ...)probe) and binds only after the model is loaded, so two simultaneous starts (e.g. Windows autostart +START-HERE.bat+ an agent script at boot) both pass the probe, each maps ~39 GB of experts, and they fight over RAM for minutes on a 32 GB PC before the loser finally fails at bind.On Windows
allow_reuse_addressis alreadyFalse, so the bind itself is safe — the hole is the check-then-bind race combined with minutes of loading in between.Proposed fix
Take a PID lock file (next to the model config,
.strata-<port>.lock) right after arg/config resolution, before tokenizer/engine loading. Second start exits in <1s with the owner's PID. Stale locks (hard kill, no atexit) are detected via PID-liveness check and taken over.Tested locally on Windows 11 + RX 9070 XT, engine 0.1.44.1:
server.py: error: another Strata server is already starting/serving port 8081 (PID 7204)in 0.2 s, no model touchedPatch (against 0.1.44.1
serve/server.py)Add after
listen_problem(~line 107):And call it in
main()right after thea.host = ...line:Environment: Windows 11, RX 9070 XT 16 GB, 32 GB RAM, IQ2_XS + Coder IQ1_M configs, port 8080.
@Niko1221 commented on GitHub (Oct 19, 2026):
Thanks for taking the time to report this.
We're resetting the tracker for 0.2.0-beta. There are more than 1,300 open issues and pull requests, too many for us to read properly, so we're closing everything that isn't being worked on right now. Closed here does not mean rejected.
To reopen it takes about two minutes:
/reopen. A check runs and either reopens the issue or lists what is still missing.The rules are in CONTRIBUTING.md.