Skip to content

Fix/shim termination on dstack server restart#2942

Closed
Bihan wants to merge 2 commits intodstackai:masterfrom
Bihan:fix/shim-termination-on-dstack-server-restart
Closed

Fix/shim termination on dstack server restart#2942
Bihan wants to merge 2 commits intodstackai:masterfrom
Bihan:fix/shim-termination-on-dstack-server-restart

Conversation

@Bihan
Copy link
Copy Markdown
Collaborator

@Bihan Bihan commented Aug 4, 2025

This PR fixes issue #2669, where the shim launched via SSH gets terminated when the dstack server restarts.

Issue Cause:
dstack's local daemon thread creates an SSH connection to the VM. The shim installation command runs on the VM via this SSH connection, unlike cloud-init setup.Even though the shim runs on the VM, it's still a child of the SSH session.When dstack server restarts → daemon thread dies → SSH connection closes.When SSH session closes, the remote shell session ends, and any processes started by that session (including the shim) get terminated.

Fix
The shim launch_command is daemonized as daemonized_command = f"{launch_command.rstrip('&')} >/tmp/dstack-shim.log 2>&1 & disown"

Note

@Bihan Bihan requested review from jvstme and peterschmidt85 August 4, 2025 03:34
@Bihan
Copy link
Copy Markdown
Collaborator Author

Bihan commented Aug 5, 2025

Will send a different PR removing Hotaisle Backend

@Bihan Bihan closed this Aug 5, 2025
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