Skip to content

[hotfix][ci] Finalize PyArrow 11 on exit in Flink 1.20 tests - #1343

Merged
wenjin272 merged 6 commits into
apache:mainfrom
wenjin272:codex/ci-python-exit-logging
Oct 30, 2026
Merged

wenjin272 merged 6 commits into
apache:mainfrom
wenjin272:codex/ci-python-exit-logging

Conversation

@wenjin272

@wenjin272 wenjin272 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Related upstream issue: apache/arrow#38364

Purpose of change

Flink 1.20 Python CI can finish all tests successfully and then crash while PyArrow 11 destroys AWS objects during process exit. Register PyArrow's existing finalize_s3() function with atexit in the CI-installed wheel so pytest and independently launched Beam workers clean up AWS resources before C++ static destruction.

Add one setup step to the Flink 1.20 Python integration job: install its dependencies and patch the shared PyArrow module before the existing test command. The shared installation covers workers that a pytest-only hook would miss. Flink 1.20's Beam dependency requires PyArrow <12, preventing an isolated upgrade to the upstream-fixed version. Remove this CI-only workaround when a compatible dependency upgrade is available.

Behavioral Semantics

Condition Result
Flink 1.20 CI, PyArrow 11.0.0, expected initialization block Register cleanup after S3 initialization
Patch already present Leave the file unchanged
Unsupported version, missing package/file, or unexpected source Fail setup rather than silently skip the fix
Other Flink versions Keep the original CI flow

The helper reads package metadata without importing native Arrow code. The normal CI matrices, test commands, and exit-code handling remain unchanged. No runtime package, public API, or dependency constraint changes. This is explicit shutdown cleanup, not a full backport of Arrow's lazy initialization.

Tests

Ten independent upstream Flink 1.20 jobs passed with the same cleanup registration. Each completed 82 E2E and 69 integration tests with both command exit codes 0. All ten core inventories and kernel crash logs were empty; dependency setup preserved the patch.

Contract Validation
Cleanup works in pytest and worker processes Ten upstream jobs with native crash collection
Expected source can be patched repeatedly Applied the current helper twice to official PyArrow 11 source and compiled the result
Only the Flink 1.20 setup flow changes Parsed workflow comparison: removing the new step exactly reproduces the base workflow

Ruff, shell syntax, and git diff --check pass. Version/source rejection was exercised during development; no standalone test harness or post-test verification step is retained. The final simplified revision still requires its normal CI run. This workaround is limited to CI and does not fix user-installed environments.

API

No public API changes.

Documentation

  • doc-needed
  • doc-not-needed
  • doc-included

Was this patch authored or co-authored using generative AI tooling?

  • Yes
  • No

Generated-by: Codex CLI 0.153.4 (GPT-6)

wenjin272 and others added 2 commits October 30, 2026 10:44
Record both command statuses before normalization and run three independent
Flink 1.20 Python integration jobs to investigate post-test CI failures.

Generated-by: Codex CLI 0.153.4 (GPT-6)
Co-authored-by: Codex <codex@openai.com>
Run ten independent Python integration samples and Ubuntu script checks. Temporarily disable unrelated jobs while the diagnostic PR remains draft.

Generated-by: Codex CLI 0.153.4 (GPT-6)

Co-authored-by: Codex <codex@openai.com>
@wenjin272 wenjin272 changed the title [hotfix][ci] Log Python test exit codes and repeat Flink 1.20 jobs [hotfix][ci] Diagnose Python exit codes with ten Flink 1.20 samples Oct 30, 2026
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs fixVersion/1.0.0 The feature or bug should be implemented/fixed in the 1.0.0 version. priority/major Default priority of the PR or issue. and removed doc-not-needed Your PR changes do not impact docs labels Oct 30, 2026
Enable runner-local kernel core dumps without wrapping pytest, export native thread stacks and environment evidence after testing, and upload text-only diagnostics for each sample.

Generated-by: Codex CLI 0.153.4 (GPT-6)

Co-authored-by: Codex <codex@openai.com>
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-not-needed Your PR changes do not impact docs labels Oct 30, 2026
Register the existing PyArrow cleanup function in the CI-installed wheel and verify the patch survives dependency setup. Keep native crash collection for ten Flink 1.20 samples.

Generated-by: Codex CLI 0.153.4 (GPT-6)

Co-authored-by: Codex <codex@openai.com>
@wenjin272 wenjin272 changed the title [hotfix][ci] Diagnose Python exit codes with ten Flink 1.20 samples [hotfix][ci] Validate PyArrow 11 shutdown cleanup for Flink 1.20 Oct 30, 2026
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-not-needed Your PR changes do not impact docs labels Oct 30, 2026
Restore all normal CI jobs and version matrices. Remove raw exit logging, core collection and repeated samples while retaining the Flink 1.20-only cleanup patch and its checks.

Generated-by: Codex CLI 0.153.4 (GPT-6)

Co-authored-by: Codex <codex@openai.com>
@wenjin272 wenjin272 changed the title [hotfix][ci] Validate PyArrow 11 shutdown cleanup for Flink 1.20 [hotfix][ci] Finalize PyArrow 11 on exit in Flink 1.20 tests Oct 30, 2026
Remove standalone patch tests and post-test verification. Keep only the Flink 1.20 setup step and guarded cleanup registration.

Generated-by: Codex CLI 0.153.4 (GPT-6)

Co-authored-by: Codex <codex@openai.com>
@wenjin272
wenjin272 marked this pull request as ready for review October 30, 2026 08:55
@github-actions github-actions Bot added doc-not-needed Your PR changes do not impact docs and removed doc-not-needed Your PR changes do not impact docs labels Oct 30, 2026
@wenjin272
wenjin272 merged commit 720a4ec into apache:main Oct 30, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs fixVersion/1.0.0 The feature or bug should be implemented/fixed in the 1.0.0 version. priority/major Default priority of the PR or issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant