Repository navigation
Commit 455aedd
Fix Worker.run()'s --unix Windows dispatch: named pipe, not AF_UNIX
vgi.worker.Worker's _run() classmethod (the CLI entry point every
Worker subclass's `main()` goes through) called serve_unix()
unconditionally for --unix, regardless of platform - crashing outright
on Windows:
AttributeError: module 'socket' has no attribute 'AF_UNIX'
(from vgi_rpc.rpc._transport.serve_unix's own
socket.socket(socket.AF_UNIX, ...) call, itself correct - AF_UNIX
genuinely doesn't exist in this code path on Windows, since CPython
has no socket.AF_UNIX there in general use).
This is a real, live bug, not theoretical: found via vgi-sqlite's own
Windows CI, whose launch: locations pass --unix a \\.\pipe\...-
formatted named pipe name on Windows (per docs/launcher-protocol.md's
own "Platform: Windows" section) - every Worker subclass fixture
(vgi-fixture-simple-writable-worker, vgi-sqlite's own row_transform
fixture) crashed near-instantly on startup as a result, while
vgi._test_fixtures.worker (used by the main vgi-fixture-worker,
built directly against vgi_rpc.rpc.run_server rather than this
classmethod) worked fine - because run_server (vgi_rpc/rpc/__init__.py)
already has the correct sys.platform == "win32" dispatch to
serve_named_pipe. This classmethod is a separate, parallel serving
path (it also handles Sentry/OTel setup and cls-specific worker
construction) that never got the same fix when run_server's was added,
so it silently diverged.
Fixed by mirroring run_server's own dispatch exactly: sys.platform ==
"win32" calls serve_named_pipe(server, unix, ...) and emits
"PIPE:<name>" on stdout; every other platform keeps the existing
serve_unix(server, os.path.abspath(unix), ...) / "UNIX:<path>" behavior
unchanged.
Not touched (a separate, narrower gap, not exercised by any of the
Windows CI failures this fix addresses): vgi/transactor/server.py's
own serve_unix() call, used only by the fuller `writable` fixture's
transactor subprocess (needs the optional transactor extra) - no test
currently reaches it on Windows.
Verified on a real Windows/MSVC box (europa): manually invoking
vgi-fixture-simple-writable-worker --unix \\.\pipe\... now correctly
emits "PIPE:\\.\pipe\..." instead of crashing. vgi-sqlite's full
Windows integration suite (test/integration, driving the built
extension via launch: locations for all three fixture workers)
re-run clean after this fix: 52 passed, 7 skipped (HTTP transport,
needs the http extra) - up from 17 failures (all in the
simple_writable- and row_transform-backed test files) before it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GSuWTdDRYPk2TziYXR4GVV1 parent 430cbb3 commit 455aedd
1 file changed
Lines changed: 44 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1613 | 1613 | | |
1614 | 1614 | | |
1615 | 1615 | | |
1616 | | - | |
1617 | | - | |
1618 | | - | |
1619 | | - | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
1620 | 1633 | | |
1621 | 1634 | | |
1622 | 1635 | | |
| |||
1629 | 1642 | | |
1630 | 1643 | | |
1631 | 1644 | | |
1632 | | - | |
1633 | 1645 | | |
1634 | 1646 | | |
1635 | | - | |
1636 | | - | |
| 1647 | + | |
| 1648 | + | |
1637 | 1649 | | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
1644 | | - | |
1645 | | - | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
| 1666 | + | |
| 1667 | + | |
| 1668 | + | |
| 1669 | + | |
| 1670 | + | |
| 1671 | + | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
1646 | 1675 | | |
1647 | 1676 | | |
1648 | 1677 | | |
| |||
0 commit comments