Skip to content

fix(start): self-heal stale start.running lock on boot#6

Open
Marinski wants to merge 1 commit into
psyb0t:masterfrom
algotradingspace:fix/start-bat-stale-lock-self-heal
Open

fix(start): self-heal stale start.running lock on boot#6
Marinski wants to merge 1 commit into
psyb0t:masterfrom
algotradingspace:fix/start-bat-stale-lock-self-heal

Conversation

@Marinski

Copy link
Copy Markdown
Contributor

start.bat holds the start.running lock for its entire launch window (killing old terminals, parsing config, launching terminals + APIs). Its own exit paths release the lock, but a forced reboot during that window - the MT5AutoReboot scheduled task, a docker restart, or a manual reboot - kills the script before it can rmdir the lock. The lock dir survives the reboot, so on the next boot start.bat exits with "Another start.bat is already running" and the VM comes up with no terminals until someone deletes the lock by hand.

Clear any leftover lock before acquiring it. A fresh boot guarantees no prior start.bat instance is alive (Windows autologon runs it once per boot), so removing a stale lock here is safe and restores automatic recovery from an interrupted start.

start.bat holds the start.running lock for its entire launch window
(killing old terminals, parsing config, launching terminals + APIs).
Its own exit paths release the lock, but a forced reboot during that
window -- the MT5AutoReboot scheduled task, a `docker restart`, or a
manual reboot -- kills the script before it can rmdir the lock. The lock
dir survives the reboot, so on the next boot start.bat exits with
"Another start.bat is already running" and the VM comes up with no
terminals until someone deletes the lock by hand.

Clear any leftover lock before acquiring it. A fresh boot guarantees no
prior start.bat instance is alive (Windows autologon runs it once per
boot), so removing a stale lock here is safe and restores automatic
recovery from an interrupted start.
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.

1 participant