Skip to content

docs(update): name the lock holder before the upgrade, not after - #856

Merged
ffroliva merged 2 commits into
developfrom
docs/848-upgrade-lock-holders
Sep 17, 2026
Merged

ffroliva merged 2 commits into
developfrom
docs/848-upgrade-lock-holders

Conversation

@ffroliva

@ffroliva ffroliva commented Sep 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

#850 shipped the detection half of #848 — gflow update now imports gflow-cli in a fresh isolated interpreter before reading any version, so a half-replaced install is reported as unusable rather than as a version. It also said plainly that the cause was unexplained.

It is partly explained now, by an independent reproduction from @Cstanish127 while testing something unrelated: an editor with gflow registered as an MCP server starts one gflow mcp run per session, they are long-lived, and on Windows they hold files inside the install open. uv tool install --force then fails on …\uv\tools\gflow-cli\Scripts and leaves the install answering No module named 'gflow_cli'.

That closes the holder-class gap in every measurement taken for #850: it is a Python process, which is what a Scripts / .pyd lock requires — chrome.exe can hold neither, so this issue's original attribution could not have been the mechanism — and it is long-lived, which is why it never reproduced from a single gflow update.

It does not close the mechanism, and the docs are hedged accordingly: the reproduction failed on the launcher dir, not on the mapped _greenlet.pyd of the original incident, where uv was measured to replace a held file successfully (exit 0). The Access is denied (os error 5) on a mapped .pyd is still open.

What this changes

The advice was already correct and already shipped — it is in the remediation gflow update prints. The problem is when you see it: after the damage. This puts it in the upgrade section, where it prevents the damage instead of recovering from it, which is what the reporter suggested.

It also names the distinguisher against the paragraph directly above it, which describes the benign Windows lock: the gflow.exe you are running holds its own trampoline, uv exits 1 copying it, and the upgrade lands anyway. A different gflow, holding the install's contents open, is the one that can leave a broken environment. Those two read as the same phenomenon with opposite guidance until you say which is which.

And it states why gflow update cannot pre-flight this itself, so the question does not get re-asked: it is one of those processes. structlog imports greenlet unconditionally, so every gflow maps the venv's native modules — a pre-flight that refused while any gflow held the install would refuse every single run. Checking for other processes named gflow is a different and much narrower check; the docs point at tasklist / pgrep -fa for it, and say that tasklist matches image names only, so a server registered as uv run gflow … shows up as uv.exe.

docs/MCP.md is the page that installs the lock holder, and it never said that registering the server gates your upgrades. One note at the end of § 4 now covers every client listed there.

Verification

Docs only — no src/ change, so no e2e applies and none was written; this touches no Flow surface and no behaviour. doc-links, website/docs mirror, website PII and repo hygiene all green, and every factual claim about gflow update was checked against src/gflow_cli/update_check.py (the -I fresh-interpreter probe, the exit-11 ConfigurationError, and the pinned forced-reinstall hint).

Closes #848

#848's three bad states came from an MCP server this repo tells people to
install. An editor with gflow registered starts one `gflow mcp run` per
session; they are long-lived and usually plural, and on Windows they hold files
inside the install open, so a package manager can abort part-way and leave the
environment broken.

The advice to stop those processes already existed — in the remediation
`gflow update` prints once the damage is done. Saying it in the upgrade section
is the difference between a recovery step and not needing one.

Also states why `gflow update` cannot pre-flight this itself: it is one of those
processes. `structlog` imports `greenlet` unconditionally, so every `gflow`
maps the venv's native modules, and refusing while any gflow holds the install
would refuse every run.

Mechanism reported with a reproduction by Cstanish127 on #824.

Closes #848
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b733c214-23f2-43a2-b8a3-54d22d0ca0b7

📥 Commits

Reviewing files that changed from the base of the PR and between 73447d8 and 91ff33d.

📒 Files selected for processing (4)
  • docs/MCP.md
  • docs/USAGE.md
  • website/docs/MCP.md
  • website/docs/USAGE.md

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The documentation now requires stopping other gflow processes before gflow update, explains Windows process detection and recovery, warns about active MCP servers, and documents required service restarts.

Changes

Windows upgrade guidance

Layer / File(s) Summary
Process lock and recovery guidance
docs/USAGE.md, website/docs/USAGE.md
The documentation explains process locks, process-discovery commands, forced-reinstall recovery, and restart requirements for gflow serve and MCP servers.
MCP server upgrade warning
docs/MCP.md, website/docs/MCP.md
The MCP documentation warns that active long-lived gflow mcp run processes can cause Windows upgrades to stop partway and leave the installation incomplete.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Other · Severity of issue fixed: Medium

Suggested reviewers: mauryanx

Merge Risk: ⚪ Minimal · up to 91ff3

The upgrade documentation provides the required process-stop and recovery guidance. No actionable current-head risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address the documentation objective for issue #848. docs/USAGE.md and website/docs/USAGE.md instruct users to stop other gflow processes before gflow update, including long-running…
Out of Scope Changes check ✅ Passed The reviewed changes are limited to update and MCP documentation in docs/USAGE.md, website/docs/USAGE.md, docs/MCP.md, and website/docs/MCP.md. Process-identification commands, lock explanatio…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main documentation change: identify the process holding the installation lock before running the upgrade.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/848-upgrade-lock-holders

Comment @coderabbitai help to get the list of available commands.

…e holder is installed

Council review of #856 converged on three findings.

Three dimensions independently flagged that the new "if an upgrade does
abort" paragraph restated the exit-11 / forced-reinstall paragraph fifteen
lines above it, with less precision — the original also names the repair
command and why a plain `upgrade` cannot do it. Replaced with a
back-reference, so the mechanism is stated once and cannot drift.

The block also contradicted the paragraph immediately before it: that one
says a running `gflow.exe` holding its own launcher is benign and the
upgrade lands anyway, this one said a running gflow leaves the environment
broken. Same-sounding phenomenon, opposite guidance, adjacent. Named the
distinguisher — the launcher you are running versus a different gflow
holding the install's contents.

`tasklist` matches image names only, so it finds the `gflow.exe` shim but
not a server registered as `uv run gflow mcp run`; said so rather than
implying parity with `pgrep -f`, which is now `-fa` so the command line
that matched is visible before anything is stopped. Softened two frequency
claims ("people actually hit", "usually more than one") that a single
reproduction does not support, per the claims discipline in AGENTS.md, and
pointed the citation at the comment carrying that reproduction instead of
the issue body, which still carries the refuted chrome.exe attribution.

docs/MCP.md is the page that installs the lock holder and never said
registering it gates upgrades; one note at the end of § 4 now covers every
client listed there. USAGE.md's own instruction landed 67 lines into the
section, so the section head now carries a one-line pointer.
@ffroliva
ffroliva merged commit 7361ae8 into develop Sep 17, 2026
22 checks passed
@ffroliva
ffroliva deleted the docs/848-upgrade-lock-holders branch September 17, 2026 07:06
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.

gflow update can leave the install BROKEN — a locked greenlet DLL aborts mid-upgrade and 0.69.0 stops working too

1 participant