Skip to content

Fix Arrow table registration with a Session - #103

Merged
wudidapaopao merged 3 commits into
mainfrom
codex/fix-arrow-session-handle
Nov 10, 2026
Merged

wudidapaopao merged 3 commits into
mainfrom
codex/fix-arrow-session-handle

Conversation

@ShawnChen-Sirius

@ShawnChen-Sirius ShawnChen-Sirius commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Use Session.connection instead of the nonexistent Session._handle when registering an Arrow table on an explicit session.
  • Reject closed sessions rather than silently falling back to the default connection.
  • Add regression tests for registration, querying, unregistering, and closed sessions.
  • Pin the clickhouse-js parity CI job to Ubuntu 24.04: the pinned upstream simdjson@0.9.2 fails to compile with GCC 15 on the current Ubuntu 26.04 latest image.

Fixes #101

Supersedes #102 with an in-repository head branch so Macroscope can run.

Validation

  • The new Session regression test reproduced the standalone-connection error before the fix.
  • npm run build:ts, all 12 Arrow-input tests, and actionlint .github/workflows/connection.yml pass locally.
  • The previous PR CI passed all checks after the Ubuntu 24.04 pin; the new in-repository PR will run fresh checks.

Note

Fix Arrow table registration to use Session.connection and skip stale unregister

  • registerArrowTable in arrow-input.ts now reads the native connection from Session.connection instead of Session._handle, and rejects a Session with no active connection.
  • The GC finalizer and unregister path capture the Session's connection at registration time. If the Session later switches or loses that connection, native unregister is skipped and the table is marked not live.
  • Adds tests for querying a registered table via session.queryAsync, rejecting a closed Session, and repeated close() after a Session is closed.
  • Behavioral Change: a closed or disconnected Session no longer performs native unregister on Arrow tables; callers relying on unregister after connection swap will see the table marked not live instead.

Macroscope summarized 9b59ba8.

Comment thread src/layer3/execute/arrow-input.ts Resolved
@ShawnChen-Sirius

Copy link
Copy Markdown
Contributor Author

@wudidapaopao, please review this PR

@wudidapaopao wudidapaopao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wudidapaopao
wudidapaopao merged commit 138df3b into main Nov 10, 2026
23 checks passed
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.

registerArrowTable with a Session uses undefined _handle instead of connection

2 participants