Skip to content

fix: Fix ValueError in signal handling for Trino worker threads#6428

Open
mbm-codes wants to merge 1 commit into
feast-dev:masterfrom
mbm-codes:fix/trino-signal-worker-thread
Open

fix: Fix ValueError in signal handling for Trino worker threads#6428
mbm-codes wants to merge 1 commit into
feast-dev:masterfrom
mbm-codes:fix/trino-signal-worker-thread

Conversation

@mbm-codes
Copy link
Copy Markdown

@mbm-codes mbm-codes commented May 21, 2026

What this PR does / why we need it:

Guards signal.signal() calls in Query.__init__() with a threading.current_thread() is threading.main_thread() check.

When the Trino offline store is served via Arrow Flight, Query.__init__() runs in a worker thread. Python restricts signal.signal() to the main thread only, causing:
ValueError: signal only works in main thread of the main interpreter

Which issue(s) this PR fixes:

Fixes #6424

Checks

  • I've made sure the tests are passing.
  • My commits are signed off (git commit -s)
  • My PR title follows conventional commits format

Testing Strategy

  • Unit tests

Misc

Added regression tests covering both main thread and worker thread scenarios.
Signal handling is preserved for CLI/interactive usage. Worker thread usage silently skips signal registration, which is the correct behavior when running under Arrow Flight.

Signed-off-by: MBM <mihir105@gmail.com>
@mbm-codes mbm-codes requested a review from a team as a code owner May 21, 2026 11:03
@mbm-codes mbm-codes changed the title Fix ValueError in signal handling for Trino worker threads fix: Fix ValueError in signal handling for Trino worker threads May 21, 2026
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.

Bug Report: signal.signal() fails in Arrow Flight worker thread in Trino offline store

1 participant