Do not hand Thunderbird the caller's stdout (v1.2.1) - #2
Open
U-C4N wants to merge 1 commit into
Open
Conversation
`_launch` redirected only stdin, so the Thunderbird it starts inherited our stdout and stderr. Since that process outlives us by design, any caller capturing our output — an agent, a CI step, a shell pipeline — stays blocked long after `install-addon` has finished its work. Their own timeout does not help: killing us leaves the grandchild holding the pipe. Observed while installing the 1.2.0 add-on: the install succeeded and the command never returned. A reduced repro had the caller waiting the full lifetime of the launched process, 45s, despite a 12s timeout. `close_fds` does not cover the standard handles and DETACHED_PROCESS only detaches the console, so both have to be redirected explicitly — which the daemon spawn in bridge.py already did. Same requirement, one file over. The regression test fails in 25s against the old code and passes in 0.4s with the fix. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Found while installing the 1.2.0 add-on on a real machine: the install succeeded, and the command never returned.
_launchinaddon_install.pyredirected onlystdin, so the Thunderbird it starts inherited ourstdoutandstderr. That process outlives us by design, so any caller capturing our output — an agent, a CI step, a shell pipeline — stays blocked until the mail client is closed. Their own timeout does not rescue them: killing the direct child leaves the grandchild holding the pipe.A reduced repro had the caller waiting the launched process's full 45s lifetime despite a 12s timeout.
close_fdsdoes not cover the standard handles, andDETACHED_PROCESSonly detaches the console — both streams have to be redirected explicitly. The daemon spawn inbridge.pyalready did exactly that; this is the same requirement one file over, and it was the only remainingPopenin the package without it.The regression test drives
_launchfrom a helper script that exits immediately and asserts the caller is released. It fails in 25s against the old code and passes in 0.4s with the fix.Versions bumped to 1.2.1 across
pyproject.toml,addon/manifest.json, andserver.py's fallback, per the unified-version rule the drift test enforces.195 tests.
🤖 Generated with Claude Code