Skip to content

refactor: keep interpreter exit signaling native - #1277

Merged
kvlonge merged 1 commit into
mainfrom
refactor/native-interpreter-exit-signal
Oct 30, 2026
Merged

kvlonge merged 1 commit into
mainfrom
refactor/native-interpreter-exit-signal

Conversation

@kvlonge

@kvlonge kvlonge commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Why

Native shutdown polling should not allocate a Python threading.Event or call Python just to read and set an internal exit flag.

Changes

  • Replace the private process-wide event with a monotonic native atomic flag.
  • Preserve existing exit hooks, worker notifications, joins, bounded waits, interruption behavior and public interfaces.
  • Remove the helper's four Python-crossing allowances. Document a symbol-scoped static-state exception for the same existing interpreter-wide shutdown signal; no new lifecycle state or Python-boundary exception.

Verification

  • Rebuilt the extension with make fast-native; its exit signal is a one-byte native symbol.
  • 76 focused tests passed, including subprocess finalization, timed-out sinks, unjoined planning and real DuckDB CLI planning.
  • cargo test -p sqlbuild-python --profile fast --lib: 9 passed.
  • Installed all extras and passed exact make check-ci, including workspace clippy, types, strict-adapter checks and zero fensu faults.
  • One bounded independent read-only review found no blockers. Duplicate analysis and private hygiene scans passed.
  • No DuckShop addition: internal synchronization-primitive refactor; no new project shape, bug fix or lifecycle behavior. Existing finalization scenarios cover the preserved contract. No performance claim or budget increase.

Replace the private process-wide threading.Event with an atomic flag while preserving existing shutdown hooks, polling, waits and public interfaces. Retire its four Python-crossing allowances and document the existing monotonic process-wide signal.

Amp-Thread-ID: https://ampcode.com/threads/T-01a18715-4e00-708e-a87d-6bd109748d66
@kvlonge
kvlonge enabled auto-merge (squash) October 30, 2026 03:34
@kvlonge
kvlonge merged commit f581f8d into main Oct 30, 2026
44 checks passed
@kvlonge
kvlonge deleted the refactor/native-interpreter-exit-signal branch October 30, 2026 04:04
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