fix(server): fall back to direct fd read on EACCES bootstrap
Stdin pipes inherited across the wsl.exe boundary fail to re-open via /proc/self/fd/0, so add EACCES to the codes that drop back to reading the fd directly. Without this the WSL desktop backend fails to load its bootstrap envelope with "Failed to duplicate bootstrap fd" and ends up in a scheduled-restart loop.
This commit is contained in:
1 parent
d1e85c4e8f
commit
f83d73b6fe
1 file changed
+4
-1
@@ -160,9 +160,12 @@ const makeDirectBootstrapStream = (fd: number): Readable => {
|
||||
}
|
||||
};
|
||||
|
||||
// Stdin pipes inherited across the wsl.exe boundary report EACCES when we try
|
||||
// to re-open them via /proc/self/fd/0 — fall back to reading the fd directly
|
||||
// in that case, the same way we already do for ENXIO/EINVAL/EPERM.
|
||||
const isBootstrapFdPathDuplicationError = Predicate.compose(
|
||||
Predicate.hasProperty("code"),
|
||||
(_) => _.code === "ENXIO" || _.code === "EINVAL" || _.code === "EPERM",
|
||||
(_) => _.code === "ENXIO" || _.code === "EINVAL" || _.code === "EPERM" || _.code === "EACCES",
|
||||
);
|
||||
|
||||
export function resolveFdPath(
|
||||
|
||||
Reference in new issue
Block a user