Skip to content

Fix Python process-pool test server lifecycle - #3677

Merged
kpumuk merged 1 commit into
apache:masterfrom
kpumuk:py-macos-build
Jul 30, 2026
Merged

Fix Python process-pool test server lifecycle#3677
kpumuk merged 1 commit into
apache:masterfrom
kpumuk:py-macos-build

Conversation

@kpumuk

@kpumuk kpumuk commented Jul 27, 2026

Copy link
Copy Markdown
Member

Python process-pool tests currently stop the server through a four-second alarm and os._exit(0). The abrupt exit bypasses normal multiprocessing cleanup, can report leaked semaphore objects, and forces every process-pool test to wait for the alarm.

Observed macOS failures from this lifecycle include:

This change replaces the alarm with a SIGTERM handler that unwinds TProcessPoolServer.serve() through its existing SystemExit handling. The client/server harness waits for the complete POSIX process group to exit and falls back to SIGKILL only when graceful shutdown times out. Windows retains equivalent terminate-and-kill fallback behavior for its supported server types.

This is a focused test-harness lifecycle fix, so Jira was intentionally skipped.

  • Did you create an Apache Jira ticket? (Request account here, not required for trivial changes)
  • If a ticket exists: Does your pull request title follow the pattern "THRIFT-NNNN: describe my issue"?
  • Did you squash your changes to a single commit? (not required, but preferred)
  • Did you do your best to avoid breaking changes? If one was needed, did you label the Jira ticket with "Breaking-Change"?
  • If your change does not involve any code, include [skip ci] anywhere in the commit message to free up build resources.

Client: py

Co-Authored-By: OpenAI Codex (GPT-5.6) <codex@openai.com>
Copilot AI review requested due to automatic review settings July 27, 2026 23:12
@kpumuk
kpumuk requested a review from mhlakhani as a code owner July 27, 2026 23:12

This comment was marked as spam.

@mergeable mergeable Bot added the python label Jul 27, 2026
@kpumuk
kpumuk merged commit 831306e into apache:master Jul 30, 2026
95 checks passed
@kpumuk
kpumuk deleted the py-macos-build branch July 30, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants