Skip to content

fix(semantic): reap MetricFlow sidecars on request cancellation - #240

Open
sol713 wants to merge 1 commit into
apache:masterfrom
sol713:fix/metricflow-sidecar-cancellation
Open

sol713 wants to merge 1 commit into
apache:masterfrom
sol713:fix/metricflow-sidecar-cancellation

Conversation

@sol713

@sol713 sol713 commented Oct 10, 2026

Copy link
Copy Markdown

Summary

Cancelled MetricFlow provider requests leave their direct child process alive. Kill and reap the child before re-raising CancelledError; tolerate an already-exited child during timeout cleanup while preserving METRICFLOW_PROVIDER_TIMEOUT.

Validation

Codex cloud, CPython 3.12, uv 0.9.0; base 5daf1de; head 9eae6e0.
Five real temporary-subprocess cases cover cancellation, deadline, success, cancellation after exit and timeout after exit, with readiness signals and test-owned cleanup. Baseline: 2 failed/3 passed; fixed plus existing MetricFlow tests: 14 passed.
Full suite: 1868 passed/85 skipped, coverage 68.14%, domain gates passed. Ruff, Mypy, Bandit, lock, catalog, build and clean-wheel checks passed. CI-pinned official MCP conformance: 25/25.

Limits and AI assistance

No real Doris database or installed MetricFlow engine tested. Spawn-phase/repeated cancellation and descendant processes are outside scope. Full license-eye scan unavailable: pinned dependency download returned HTTP 403; changed headers checked. Upstream CI has not run.
OpenAI Codex produced and reviewed the implementation/tests and performed cloud verification. Human review and any contributor agreements remain for the contributor; none asserted here. Independent of #239, #224 and #234.

Kill and wait for the direct sidecar child before preserving caller cancellation.
Handle already-exited children without replacing the provider timeout error.
Cover cancellation, deadline, success, and exit races with real subprocess tests.

Generated-by: OpenAI Codex (GPT-6)
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.

1 participant