Repository navigation
Conversation
…rror The VM driver listens on <state_dir>/run/compute-driver.sock. When that path exceeds the platform's Unix socket limit the driver exits with a bare 'path must be shorter than SUN_LEN' and the gateway can only report the driver's exit status. Check the path in prepare_compute_driver_socket_path before any directory is created, and name the path, its length, the limit and the state_dir setting in the error. The limit is 107 bytes on Linux and 103 elsewhere. Note the constraint in the VM driver configuration docs. Closes NVIDIA#4178 Signed-off-by: Shiju <shiju@nvidia.com>
|
Could we extend the approach from #3544 to the remaining gateway-to-driver The diagnostic here is useful, but users with long state paths still cannot start the gateway. Please allocate a short, gateway-owned socket directory under Please also cover startup with an overlong |
Allocate a private random directory under /tmp and retain it with the managed driver process. Keep persistent VM state at the configured path and cover long-path startup, collision handling, and cleanup. Signed-off-by: Shiju <shiju@nvidia.com>
|
The PR initially focused on giving users a clearer error message. The gateway now creates a private, randomly named directory under /tmp for compute-driver.sock. |
elezar
left a comment
There was a problem hiding this comment.
Maybe a question: Are there other paths where we could expect this to happen? Should we expose a shared check to sanitize these paths?
|
it's all the |
|
Audited source:
|
|
Would the team prefer expanding this PR to cover the other socket paths? I'm thinking of adding shared address validation before filesystem changes or connection retries, and consolidating private short-directory allocation. The validator could live in extension-core and be re-exported from core. VM sandbox sockets would also need compact directory names so long sandbox IDs don’t exceed the limit. Alternatively, I can keep this PR focused and address the broader changes in a follow-up. |
|
This pull request has had no activity for 14 days and is now marked stale. |
Merge current main while preserving the managed VM driver's private socket directory and persistent state location. Share pathname length checks across driver, extension, supervisor and sandbox endpoints, and use compact VM sandbox socket directory names for long sandbox IDs. Closes NVIDIA#4178 Signed-off-by: Shiju <shiju@nvidia.com>
Summary
The gateway can now start with a long VM
state_dir: its managed driver's control socket lives in a private, randomly named/tmpdirectory owned by the managed process, while persistent state stays in the configured directory. VM sandbox sockets use fixed-length directory names so accepted 128-byte IDs fit. A shared filesystem pathname length check gives configured driver/extension endpoints and OpenShell listeners an error naming the path, its byte length and the platform limit before filesystem preparation or connection retries.Related Issue
Closes #4178
Changes
openshell_extension_core::unix_socket_path::check, re-exported from core: 107 bytes on Linux and 103 on macOS, excluding the terminating NUL.Temporary directories are cleaned up through normal ownership;
SIGKILLcan leave an unused directory behind. Subsequent launches allocate a fresh private directory.Testing
18 focused tests passed on macOS: shared validator/extension checks; long VM sandbox IDs; public gateway startup with an overlong state directory; cleanup on drop, early exit and cancellation; collision handling; configured driver paths; and standalone VM argument validation. Scoped Clippy passed with warnings denied across all targets of the 11 affected packages, alongside formatting, license-header and shell-syntax checks. Independent local Gator review passed. These checks did not boot a real VM or exercise Linux runtime behavior.
Checklist