Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

q2 render should take a lockfile in the output directory so two concurrent renders cannot interleave their writes

オープン
#900 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
build-system

調査の方向性

Start by locating the q2 render and q2 preview render entry points and how they determine the output directory; the issue does not name files or tests. Then trace render lifecycle and signal handling to see where a lock can be acquired and released. Done means concurrent renders are rejected with a useful diagnostic, stale locks do not block rendering, and preview holds the lock only during rendering.

索引モデルが issue の本文から書いたものです。

説明

Summary

Two renders of the same project can run at the same time and write the same output directory: a q2 preview --static that re-renders on file changes, and a q2 render started by hand (or by an editor task, a CI step, a second terminal). Nothing stops the second one, and the two interleave their writes. Proposal: q2 render takes a lockfile in the output directory for the duration of a render and steps back, with a diagnostic, when another render already holds it. Quarto 1 never did this; it is cheap and catches the easy mistakes.

What happened

A website project was being served with q2 preview --static, which watches the project and re-renders it when a source file changes. While it was running, I edited _quarto.yml and ran q2 render in another terminal. Both renders ran at once into _site/.

The render completed without diagnostics, but the search index was broken afterwards:

  • site_libs/quarto-search/pagefind/pagefind-entry.json named an index hash (en_3a8a4314f7),
  • the matching pagefind.en_3a8a4314f7.pf_meta file was missing from the directory,
  • in the browser, every query returned "No results", with Failed to load the meta index: Error: invalid gzip data and Pagefind: WASM Error (No pointer) on the console (the server answered the missing file with a 404 text body, which the runtime tried to gunzip).

Stopping the preview and rendering once more fixed it. I could not reproduce the missing file with a single renderer, with or without incremental renders, so the cause is the interleaving: one render's search-index step wrote its files while the other was replacing the directory.

The search index is just the piece that broke visibly. Any whole-directory output (site_libs/, the Pagefind index, llms-full.txt, alias redirects) is open to the same interleaving, and the symptoms are confusing because the final log line of each render says it succeeded.

Proposal

  • When a render starts, create a lockfile in the output directory (for example _site/.quarto-render.lock, or next to the other render bookkeeping under .quarto/). Write the pid, the start time, and the command that holds it.
  • If the lock exists and its holder is alive, do not render. Emit a diagnostic naming the holder ("another render of this project is running: q2 preview pid 12345, started 10:57:03") and exit non-zero. A --wait flag or a short bounded wait before giving up would cover the common case of a preview mid-render.
  • If the lock exists but its pid is gone, treat it as stale: remove it, say so, and continue. A crash must not wedge the project.
  • q2 preview holds the lock only while it is actually rendering, not while it is merely serving and watching, so a manual render between edits still works when the preview is idle.
  • Release the lock on success, failure, and signal.

Races remain possible (two renders starting in the same instant, network file systems, lock files are not transactions), and that is acceptable. The goal is that the obvious mistake, a hand-run render against a watched project, fails loudly instead of corrupting the output silently.

Environment

q2 0.35.0-nightly.20261021, macOS.

主要言語
Rust
スター
278
フォーク
19
平均マージ
21時間 56分
マージ済み PR(30日)
156

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

quarto-dev/q2 のほかの issue

quarto-dev/q2 の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。