Repository navigation
Reserve the transient .quarto_ipynb before writing it - #15364
Open
EnginKarahan wants to merge 1 commit into
Open
EnginKarahan wants to merge 1 commit into
EnginKarahan wants to merge 1 commit into
Conversation
The name of the transient notebook was picked with an existsSync loop, but the file was only written after an await. A render and a concurrent `quarto inspect` of the same document (Posit Publisher in Positron runs inspect on every save) could pick the same name, and the first to finish removed the notebook the other one was still using, failing the render with [Errno 2]. Create the file with createNew instead, so each process gets its own name.
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Description
Fixes #15361.
target()in the Jupyter engine picked the name of the transient notebook with anexistsSyncloop and wrote the file only afterawait quartoMdToJupyter(...). A render and a concurrentquarto inspectof the same document both saw a free name, and the first to finish removed the notebook the other one was still using. The name is now reserved by creating the file withcreateNewin a small helper,reserveTransientNotebook, and a failed conversion removes the reserved file again.OpenOptionsinsrc/deno_ral/fs.tsgainscreateNewfor this.With the reproduction from the issue, a dev build of
mainfailed in 6 of 8 runs, and this branch in 0 of 10, with no transient notebooks left behind. New unit tests intests/unit/jupyter/transient-notebook.test.tscover the reservation.tests/smoke/inspect/inspect-cleanup.test.ts,tests/unit/preview-compatibility.test.tsandtests/unit/project/file-information-cache.test.tspass.Checklist
I have (if applicable):
AI-assisted PR
.claude/rules/, reproduction script from the issue