Skip to content

patch: replace errno-87 retry with dropping the redundant second open#3

Open
MarshallOfSound wants to merge 1 commit intomainfrom
sam/drop-second-open
Open

patch: replace errno-87 retry with dropping the redundant second open#3
MarshallOfSound wants to merge 1 commit intomainfrom
sam/drop-second-open

Conversation

@MarshallOfSound
Copy link
Copy Markdown
Member

Replaces the ERROR_INVALID_PARAMETER retry with the root-cause fix.

The investigation on electron/electron branch sam/windows-io-repro pinned the failure to bindflt.sys's handling of handle-relative NtCreateFile on a mapped directory: a second relative-path open of the same target while the first handle is still being set up intermittently returns errno 87. Single opens of the same files (same relative paths, same emptyDir, same 32-way concurrency) never hit it — so removing readFile's per-chunk re-open and sharing the outer *os.File for ReadAt (documented concurrent-safe) takes the manifest-load failure rate to zero without a retry.

Diff is a 7-line deletion in fileParser.readFile. Also halves the CreateFileW calls during the subninja scan.

After this merges, tag v1.5.7-electron.3; we can then drop the openfile_windows.go retry from the upstream CL and send this instead.

Root cause is a bindflt.sys race on handle-relative NtCreateFile when
a second relative open arrives while the first handle to the same
target is live (see the investigation on electron/electron
sam/windows-io-repro). Single opens on the same files, same relative
paths, same bindflt emptyDir do not trigger it — so sharing the outer
*os.File for ReadAt (which is documented concurrent-safe) removes the
only overlapping-open in the manifest loader and makes the retry
unnecessary. 7-line deletion; also halves CreateFileW calls per
subninja.
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