Repository navigation
fix(studio-server): check and render keep their history on a drive without hard links - #7737
Open
miguel-heygen wants to merge 1 commit into
Open
miguel-heygen wants to merge 1 commit into
miguel-heygen wants to merge 1 commit into
Conversation
…thout hard links The history lock had its own list of the errors that mean a drive cannot hard-link, and it lacked EISDIR, which Windows returns on a Google Drive folder. Every check report and render record there failed. The lock now uses core's list, the one owner, which also gains ENOSYS from the lock.
Contributor
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
On a drive that cannot make hard links, such as a Google Drive folder on Windows,
hyperframes checknow records its report andhyperframes renderrecords the render again. Before, both finished their real work and then failed withEISDIR: illegal operation on a directory, link '.hyperframes/video-state-lock/owner.pid-<pid>-<uuid>.tmp' -> '.hyperframes/video-state-lock/owner.pid'.Why
The project history lock publishes
owner.pidwithlink(), and when the drive cannot hard-link it should fall back to an exclusive write. It decided that from its own list of error codes (ENOTSUP,EOPNOTSUPP,ENOSYS,EPERM,EACCES). That list lackedEISDIR, which Windows returns forlink()on such drives (libuv mapsERROR_INVALID_FUNCTIONto it). Core's atomic file writes already treatedEISDIRandEXDEVas "no hard links", so the same drive worked for file saves and failed for the lock.Every caller of the lock failed the same way: "Check report was not recorded", "Post-render step recordRenderSuccess failed" and "Render output was not registered".
Related work
None.
How
packages/core/src/atomicFile.tsowns the list and exportscannotHardLink(error). The list gainsENOSYS, which only the lock had.packages/studio-server/src/history/ownerLock.tsusescannotHardLinkand drops its own copy, so the two can no longer drift.link()callers (the engine's frame cache and the producer's plan) already copy on any link failure; unchanged.Test plan
ownerLock.test.ts: the "takes the lock when linking fails with %s" cases now includeEISDIRandEXDEV.takes the lock when linking fails with EISDIRand... with EXDEVfail (2 failed, 22 passed), andatomicFile.test.ts's newENOSYScase fails (1 failed); with the fix, 24 passed and 40 passed (1 skipped as root, unrelated), 3 runs in a row.tsc --noEmitforpackages/coreandpackages/studio-server,oxlintandoxfmton the four files: clean.link()error.