Repository navigation
Conversation
|
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 |
|
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. |
|
I've expanded this beyond the original diagnostic. Managed VM sockets now use short, private paths under /tmp, so deep state directories and long sandbox IDs don’t block startup. Other configured OpenShell socket paths get a shared check before filesystem changes or connection retries. |
|
Label |
684406c to
789b26b
Compare
|
This pull request has had no activity for 14 days and is now marked stale. |
9c78720 to
7f88d8a
Compare
The gateway can now start with a long VM `state_dir`: its managed driver's control socket lives in a private, randomly named `/tmp` directory 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. Signed-off-by: Shiju <shiju@nvidia.com>
7f88d8a to
4c45591
Compare
elezar
left a comment
There was a problem hiding this comment.
Thanks for this. The shared unix_socket_path::check is a good addition, and the clear error naming the path, its length and the limit is what #4178 needs. I reviewed against current main, which already has the launcher from #5914 and #6035, and I think the launcher can carry more of this fix.
Suggested changes
1. Make the short private socket directory the launcher's default for every launched driver.
prepare_socket now takes Option<&Path> and falls back to /tmp only for VM. Docker and Podman still pass <state_dir>/run/<name> from LocalDriver::socket_dir(), so a long state_dir still stops them from starting. They now fail with the clear error instead of a connect failure, but they still fail.
The launcher already creates a random-named 0700 directory per launch and removes it through LaunchDir and ManagedDriverProcess. That makes the persistent run/ directory unnecessary. Dropping socket_dir from LaunchRequest, and deleting LocalDriver::socket_dir() and VmLaunchPlan::socket_dir(), would fix #4178 for all three launched drivers. It would also remove the Option plumbing and most of the re-indented validation in prepare_socket.
2. Make the /tmp choice explicit.
Use a named constant with one comment explaining why TMPDIR is avoided on macOS. Run unix_socket_path::check on the planned path before creating the directory, so a failure doesn't leave one behind.
Smaller points
- Test through the launcher. Please confirm the "overlong state directory" test goes through
launcher::launchand not only the plan. A case for a non-VM driver would cover item 1. Nothing here runs on Linux, including the abstract-socket behavior the description says is preserved. - VM sandbox directory names. They are now a 16-byte SHA-256 prefix. Logging the sandbox ID to directory mapping at create time would keep them debuggable. In cleanup,
let Ok(leaf) = ... else { return }silently leaks a directory if hashing fails, so please log it. - Scope. The PR spans about 27 files, including the credential issuer, supervisor and sandbox listeners. If item 1 lands, consider splitting it into launcher and driver socket location, and the shared validator with the listener checks. The launcher change is then easier to review.
The docs updates and the removal of the VM driver's own MAX_SUN_PATH_LEN look right to me.
I haven't built or run this. I read the launcher, VM driver and gateway diffs closely and skimmed the rest.
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