Skip to content

feat(bigtable): support the accelerator on Windows x86_64 and x86 - #18778

Merged
mutianf merged 3 commits into
bigtable-accelfrom
accel10
Oct 26, 2026
Merged

mutianf merged 3 commits into
bigtable-accelfrom
accel10

Conversation

@mutianf

@mutianf mutianf commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

The Go daemon gained Windows UDS support in googleapis/google-cloud-go#20455, so this lifts the sys.platform == "win32" block and fixes the POSIX assumptions behind it.

@mutianf
mutianf requested a review from a team as a code owner October 20, 2026 16:16
@mutianf
mutianf added this pull request to stack #18691 October 20, 2026 16:18

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Windows support for the Bigtable accelerator daemon. It handles Windows-specific binary naming, adjusts socket liveness checks and stale directory sweeping to accommodate Windows filesystem and socket behaviors, and updates the gRPC socket target format to support drive-lettered paths. The review feedback points out a critical issue where checking hasattr(socket, 'AF_UNIX') is insufficient on Python 3.9+ because CPython exposes AF_UNIX on Windows, which would bypass the intended Windows fallback logic. It is recommended to use the _IS_WINDOWS constant directly instead.

# console control event to TerminateProcess, so that same call would
# *kill* the spawning Python process it is supposed to be asking
# about — someone else's live application. Porting it needs an
# OpenProcess/WaitForSingleObject check instead, which is left for a

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sweep is correctly disabled on Windows, but as noted the trade is that leftover tempdirs accumulate in %TEMP% across daemon restarts/crashes. Worth filing a tracked follow-up to port the liveness check to OpenProcess + GetExitCodeProcess (or WaitForSingleObject with timeout 0) so this doesn't quietly turn into a %TEMP% pollution bug report in six months.

# tempfile.mkdtemp(prefix="bt-accel-") placement keeps the socket path well
# under the limit on every platform.
@pytest.fixture
def tmp_path():

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Module-scoped tmp_path override silently shadows pytest's built-in for every test in the file. Rationale (sockaddr_un.sun_path limit) is correct and well-commented, but a future contributor who adds a test here and expects pytest's standard tmp_path layout (e.g., for a fixture that assumes the pytest-of-user tree) will be confused. Suggest renaming to short_tmp_path or similar so tests opt in explicitly to the shortened path.

monkeypatch.setattr(_daemon.os.path, "exists", lambda p: False)
# Nothing ever binds the socket, so the readiness channel stays in
# TRANSIENT_FAILURE and the deadline is what ends the wait.
monkeypatch.setenv(_STARTUP_TIMEOUT_ENV_VAR, "0.05")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test used to monkeypatch os.path.exists to always return False so the UDS "could never appear"; after the readiness-probe switch it now relies on the gRPC channel staying in TRANSIENT_FAILURE for the 50 ms timeout. Fine today, but if the OS ever puts something at the real uds_path (unlikely with tempfile.mkdtemp's 0700 mode, but not impossible in odd CI setups), this test could spuriously pass the readiness probe and then fail an unrelated assertion. Consider re-adding an explicit "nothing is listening on this socket" guard — e.g., assert grpc.channel_ready_future(...).result(0.1) raises on a bare mkdtemp() path first, so the test anchors the failure mode.

@sushanb sushanb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Approach is sound — AF_UNIX end-to-end via gRPC C-core, channel_ready_future probe (a nice improvement on POSIX too, since bare connect() succeeded on the listen backlog before gRPC was accepting), and the pid-liveness sweep gated off until Windows gets an OpenProcess port. Three low-severity follow-ups above (Windows sweep tracking issue, tmp_path fixture naming, test_uds_never_appears guard). None are blockers.

Base automatically changed from accel9 to bigtable-accel October 26, 2026 15:31
Change-Id: I7a17dd9919dff6e9d38b0cdfb3c600ffc363900c
…_uds_target

Change-Id: I4ee8c69a938ff86ab6967642809a70f5330af25b
… a raw socket connect

Change-Id: I1f9899ed28dc504fbdbfdb2a93d34a404e187301
@mutianf
mutianf merged commit 63884bc into bigtable-accel Oct 26, 2026
6 checks passed
@mutianf
mutianf deleted the accel10 branch October 26, 2026 17:31
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.

2 participants

⌂ 换网址