Repository navigation
feat(config): bump HttpConfig pool_max_idle_per_host default 10 → 100 (stack 6/8) - #30
Closed
msrathore-db wants to merge 1 commit into
Closed
msrathore-db wants to merge 1 commit into
msrathore-db wants to merge 1 commit into
Conversation
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 17, 2026 13:15
c7e6399 to
b896baf
Compare
msrathore-db
changed the base branch from
msrathore/kernel-async-public-api
to
msrathore/kernel-oauth-error-class
May 17, 2026 13:15
This was referenced May 17, 2026
Closed
This was referenced May 17, 2026
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 20, 2026 10:36
b896baf to
bb2dc5e
Compare
msrathore-db
force-pushed
the
msrathore/kernel-oauth-error-class
branch
2 times, most recently
from
May 20, 2026 16:55
5199c59 to
3333527
Compare
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 20, 2026 16:55
bb2dc5e to
54e5800
Compare
msrathore-db
force-pushed
the
msrathore/kernel-oauth-error-class
branch
from
May 20, 2026 20:22
3333527 to
f6a3a0e
Compare
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 20, 2026 20:22
54e5800 to
86d21b4
Compare
msrathore-db
force-pushed
the
msrathore/kernel-oauth-error-class
branch
from
May 21, 2026 00:03
f6a3a0e to
6db8e4d
Compare
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 21, 2026 00:03
86d21b4 to
f13abf5
Compare
msrathore-db
force-pushed
the
msrathore/kernel-oauth-error-class
branch
from
May 23, 2026 11:03
6db8e4d to
f3505e7
Compare
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 23, 2026 11:03
f13abf5 to
3a5ba83
Compare
msrathore-db
force-pushed
the
msrathore/kernel-oauth-error-class
branch
from
May 23, 2026 11:30
f3505e7 to
fb8bcfb
Compare
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 23, 2026 11:30
3a5ba83 to
97515ae
Compare
msrathore-db
force-pushed
the
msrathore/kernel-oauth-error-class
branch
from
May 23, 2026 21:48
fb8bcfb to
de6966d
Compare
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 23, 2026 21:48
97515ae to
0e66279
Compare
msrathore-db
force-pushed
the
msrathore/kernel-oauth-error-class
branch
from
May 24, 2026 15:54
de6966d to
5badf23
Compare
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 24, 2026 15:54
0e66279 to
0fd53f1
Compare
msrathore-db
force-pushed
the
msrathore/kernel-oauth-error-class
branch
from
May 24, 2026 18:09
5badf23 to
4c83f26
Compare
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 24, 2026 18:09
0fd53f1 to
f7bcc87
Compare
msrathore-db
force-pushed
the
msrathore/kernel-oauth-error-class
branch
from
May 24, 2026 18:43
4c83f26 to
185096c
Compare
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 24, 2026 18:43
f7bcc87 to
122e6d3
Compare
vikrantpuppala
pushed a commit
that referenced
this pull request
May 25, 2026
…tement + rustls-tls (stack 1/8) (#26) ## Stack Linear stack of 8 PRs on `databricks/databricks-sql-kernel` landing the **SEA-driver kernel-side enablement** work. Merge in order from base ↑ to tip. The tip branch (`msrathore/krn-status-fields`, PR [#23](#23)) is the single snapshot containing every kernel-side change in flight. | Pos | PR | Branch | Scope | |---|---|---|---| | 1/8 | [#26](#26) | `kernel-async-public-api` | Remove `block_on` from ResultStream + Send-safety on Statement + rustls-tls switch via Cargo features + e2e test ported from [#20](#20) | | 2/8 | [#27](#27) | `kernel-napi-skeleton` | napi-rs binding crate skeleton (opts INTO `tls-rustls` feature from creation) | | 3/8 | [#25](#25) | `kernel-napi-classes` | Database / Connection / Statement / ResultStream napi classes | | 4/8 | [#29](#29) | `kernel-napi-statement-validity` | StatementInner ValidityFlag fix propagated from sea-operation | | 5/8 | [#28](#28) | `kernel-oauth-error-class` | Reclassify OAuth token-exchange failures as `Error::unauthenticated()` | | 6/8 | [#30](#30) | `krn-connection-pool-default-bump` | Bump `HttpConfig.pool_max_idle_per_host` default 10 → 100 | | 7/8 | [#24](#24) | `krn-tls-public-api` | Expose `TlsConfig` fields (custom_ca_cert + accept_self_signed + skip_hostname_verification) | | 8/8 | [#23](#23) | `krn-status-fields` **← TIP** | Expose 5 status accessors on `ExecutedStatement` | **Policy:** new PRs always stack on the current tip. No sibling/parallel topology. --- **This PR is position 1/8 (ROOT of the kernel stack).** ## Summary Four commits in this PR. Two kernel correctness fixes that unblock async consumers (napi, pyo3), a Cargo-feature-based TLS backend split to preserve ODBC compatibility, plus a regression test for the block_on fix: - `49ffdcb` — `fix(kernel): remove block_on from ResultStream async public surface` (305 LOC, 7 files). The previous `ResultStream` accessors used `tokio::block_on` internally, which panics with "Cannot start a runtime from within a runtime" when called from inside an enclosing tokio runtime — exactly what napi-rs's `execute_tokio_future` and PyO3's wrapper runtime do. Fix: make the `ResultReader` trait itself `async` via `async_trait`. **This is Option 1 in [issue #19](#19 — the documented "right answer" — vs the Option 2 stopgap in [PR #20](#20). - `622a59a` — `krn-async-public-api: make Statement::execute/submit Send and switch to rustls-tls` (137 LOC, 2 files). Made the futures Send + switched reqwest's TLS backend to rustls-tls. - `7c4755a` — `test(reader): port cloudfetch_drain_does_not_nest_block_on from PR #20`. E2e regression test (49 LOC) drains 1M rows from inside a `#[tokio::test(flavor = "multi_thread")]`. - `d96afd9` — `feat(config): make TLS backend selectable via Cargo features` (NEW). Splits the prior unconditional rustls switch into two opt-in features: - `default = ["tls-native"]` — direct-Rust users, C-ABI / future ODBC path get the historical `native-tls` backend. - `tls-rustls` — napi-rs binding crate (added in next PR in this stack) opts in to avoid OpenSSL-symbol clash with Node.js. ## Why the TLS-feature commit was needed `622a59a` hardcoded rustls-tls because the napi binding loaded into Node segfaults on OpenSSL 1.1 symbol clash. But that pre-empted the choice for ODBC consumers who historically use native-tls. The new `d96afd9` commit makes the backend configurable so each consumer picks its own. **Default kept as native-tls** so existing direct-Rust callers + the C-ABI / ODBC path see no behavior change. Verified locally: - `cargo check -p databricks-sql-kernel` (default tls-native): clean - `cargo check --workspace` (kernel native-tls + napi rustls-tls in same workspace): clean - `cargo test --lib --workspace`: **376 passed / 0 failed** Side benefit: the pre-existing PEM flake `test_http_client_with_invalid_pem` (D-016 in the workflow) which was failing on the rustls-tls build now passes on native-tls. CI default is back to a fully-green state. ## Test plan - `cargo test` — full lib tests still green (376 passing) - `cargo clippy --all-targets -- -D warnings` clean - Downstream napi binding builds against this surface; M2M e2e green at `sea-auth-u2m@e7c979d` on databricks-sql-nodejs ## Tracking - [PECOBLR-2670](https://databricks.atlassian.net/browse/PECOBLR-2670) — Make the async interface for rust kernel - [PECOBLR-2917](https://databricks.atlassian.net/browse/PECOBLR-2917) — Fix napi binding SIGSEGV on concurrent openSession - Parent epic: [PECOBLR-2666](https://databricks.atlassian.net/browse/PECOBLR-2666) Co-authored-by: Isaac [PECOBLR-2670]: https://databricks.atlassian.net/browse/PECOBLR-2670?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
msrathore-db
added a commit
that referenced
this pull request
May 25, 2026
…lope + util + runtime + logger (stack 2/8) (#27) ## Stack Linear stack of 8 PRs on `databricks/databricks-sql-kernel` landing the **SEA-driver kernel-side enablement** work. Merge in order from base ↑ to tip. The tip branch (`msrathore/krn-status-fields`, PR [#23](#23)) is the single snapshot containing every kernel-side change in flight. | Pos | PR | Branch | Scope | |---|---|---|---| | 1/8 | [#26](#26) | `kernel-async-public-api` | Remove `block_on` from ResultStream + Send-safety on Statement + rustls-tls + e2e test ported from [#20](#20) | | 2/8 | [#27](#27) | `kernel-napi-skeleton` | napi-rs binding crate skeleton: Cargo manifest + lib + error envelope + util + runtime + logger | | 3/8 | [#25](#25) | `kernel-napi-classes` | Database / Connection / Statement / ResultStream napi classes | | 4/8 | [#29](#29) | `kernel-napi-statement-validity` | StatementInner ValidityFlag fix propagated from sea-operation | | 5/8 | [#28](#28) | `kernel-oauth-error-class` | Reclassify OAuth token-exchange failures as `Error::unauthenticated()` (2-line fix in auth/oauth/m2m.rs + u2m.rs) | | 6/8 | [#30](#30) | `krn-connection-pool-default-bump` | Bump `HttpConfig.pool_max_idle_per_host` default from 10 → 100 | | 7/8 | [#24](#24) | `krn-tls-public-api` | Expose `TlsConfig` fields (custom_ca_cert + accept_self_signed + skip_hostname_verification) + stop discarding in session.rs | | 8/8 | [#23](#23) | `krn-status-fields` **← TIP** | Expose 5 status accessors on `ExecutedStatement` (num_modified_rows / progress / display_message / diagnostic_info / error_details_json) | **Companion NodeJS stack** (`databricks/databricks-sql-nodejs`): 8 PRs — root [#378](databricks/databricks-sql-nodejs#378) (sea-abstraction) → [#380](databricks/databricks-sql-nodejs#380) → [#377](databricks/databricks-sql-nodejs#377) → [#379](databricks/databricks-sql-nodejs#379) → [#382](databricks/databricks-sql-nodejs#382) → [#381](databricks/databricks-sql-nodejs#381) → [#384](databricks/databricks-sql-nodejs#384) → [#383](databricks/databricks-sql-nodejs#383) (tip). **Policy:** new PRs always stack on the current tip. No sibling/parallel topology. No force-pushes on existing PRs unless absolutely necessary; if a PR's content is wrong, add a fix-up commit on top of the stack tip rather than rewriting history. --- **This PR is position 2/8.** ## Summary Lands the napi-rs binding crate as a workspace member with **infrastructure only**: no exported classes yet. ~442 LOC across 10 files. **Files added:** - `Cargo.toml` — workspace membership declaration - `napi/Cargo.toml`, `napi/build.rs`, `napi/package.json`, `napi/.gitignore` — crate manifest + napi-rs build glue - `napi/src/lib.rs` — entry point declaring 4 infra modules (no class modules yet); exports a smoke-test `version()` fn - `napi/src/error.rs` — formatter for the `__databricks_error__:<json>` napi error envelope decoded by the JS-side adapter - `napi/src/util.rs` — shared helpers - `napi/src/runtime.rs` — tokio multi-thread runtime helper - `napi/src/logger.rs` — `tracing`-to-JS logger bridge stub ## Compilability `cargo check -p databricks-sea-native` is clean. The crate compiles standalone and exposes only the `version()` probe — the JS-side loader would find a valid `.node` but no functional API yet. This split makes the infra layer reviewable on its own; the next PR adds the user-facing surface. ## Tracking - [PECOBLR-2670](https://databricks.atlassian.net/browse/PECOBLR-2670) — Make the async interface for rust kernel — napi crate skeleton - Parent epic: [PECOBLR-2666](https://databricks.atlassian.net/browse/PECOBLR-2666) Co-authored-by: Isaac [PECOBLR-2670]: https://databricks.atlassian.net/browse/PECOBLR-2670?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
vikrantpuppala
pushed a commit
that referenced
this pull request
May 25, 2026
…in) (#66) Re-targets [#27](#27) against `main`. ## What happened PR #27 was stacked on PR #26's branch (`msrathore/kernel-async-public-api`). When PR #26 squash-merged into `main` (commit `f4a18ba`), PR #27's base was not re-pointed to `main`, so merging PR #27 landed its content on the now-stale `msrathore/kernel-async-public-api` branch (merge commit `b73a688`) rather than on `main`. Result: the napi-skeleton content is not on `main` despite #27 being marked as merged. ## What this PR does Cherry-picks the squash commit from #27 (`b73a688`) onto a fresh branch from current `main`. Content is identical to what #27 should have landed — same 12 files, same `+3771 / -2` line counts. ## Review history All review approval is on #27; this PR carries the identical diff. Re-review is not required but pre-commit gate has been verified: - `cargo fmt --all -- --check` — clean - `cargo clippy --all-targets --locked -- -D warnings` — clean - `cargo test --locked` — 14 / 14 pass - `cargo build --release --locked` — clean ## Stack context This is the second of an 8-PR kernel stack (PR #26 was the first; #25/#29/#28/#30/#24/#23 follow). Each subsequent PR's base will need to be updated to point at this PR's branch (`msrathore/kernel-napi-skeleton-to-main`) once it merges to main, mirroring the same re-target pattern. ## Files - `.github/workflows/napi-checks.yml` — CI workflow for the napi crate (fmt + clippy + test + release-build with `--locked`) - `Cargo.toml` — root workspace tweak so the napi sub-crate's standalone-workspace pattern works - `napi/.gitignore`, `napi/Cargo.toml`, `napi/Cargo.lock`, `napi/build.rs`, `napi/package.json` — crate manifest + napi-rs build glue - `napi/src/lib.rs` — crate root, `version()` napi export - `napi/src/error.rs` — kernel `Error` → napi `Error` envelope mapper + pyo3 field-parity guards - `napi/src/util.rs` — `guarded()` panic-catching wrapper + `panic = "abort"` compile-time guard - `napi/src/runtime.rs` — captured tokio `Handle` accessor + PERF NOTE + async-cleanup-hook TODO for PR #25 - `napi/src/logger.rs` — Round-3 logger bridge stub with inline design sketch Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
msrathore-db
force-pushed
the
msrathore/kernel-oauth-error-class
branch
from
May 25, 2026 19:20
185096c to
09472d7
Compare
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 25, 2026 19:20
122e6d3 to
c14c1ff
Compare
vikrantpuppala
pushed a commit
that referenced
this pull request
May 26, 2026
…3/8) (#25) ## Stack Linear stack of 8 PRs on `databricks/databricks-sql-kernel` landing the **SEA-driver kernel-side enablement** work. Merge in order from base ↑ to tip. The tip branch (`msrathore/krn-status-fields`, PR [#23](#23)) is the single snapshot containing every kernel-side change in flight. | Pos | PR | Branch | Scope | |---|---|---|---| | 1/8 | [#26](#26) | `kernel-async-public-api` | Remove `block_on` from ResultStream + Send-safety on Statement + rustls-tls + e2e test ported from [#20](#20) | | 2/8 | [#27](#27) | `kernel-napi-skeleton` | napi-rs binding crate skeleton: Cargo manifest + lib + error envelope + util + runtime + logger | | 3/8 | [#25](#25) | `kernel-napi-classes` | Database / Connection / Statement / ResultStream napi classes | | 4/8 | [#29](#29) | `kernel-napi-statement-validity` | StatementInner ValidityFlag fix propagated from sea-operation | | 5/8 | [#28](#28) | `kernel-oauth-error-class` | Reclassify OAuth token-exchange failures as `Error::unauthenticated()` (2-line fix in auth/oauth/m2m.rs + u2m.rs) | | 6/8 | [#30](#30) | `krn-connection-pool-default-bump` | Bump `HttpConfig.pool_max_idle_per_host` default from 10 → 100 | | 7/8 | [#24](#24) | `krn-tls-public-api` | Expose `TlsConfig` fields (custom_ca_cert + accept_self_signed + skip_hostname_verification) + stop discarding in session.rs | | 8/8 | [#23](#23) | `krn-status-fields` **← TIP** | Expose 5 status accessors on `ExecutedStatement` (num_modified_rows / progress / display_message / diagnostic_info / error_details_json) | **Companion NodeJS stack** (`databricks/databricks-sql-nodejs`): 8 PRs — root [#378](databricks/databricks-sql-nodejs#378) (sea-abstraction) → [#380](databricks/databricks-sql-nodejs#380) → [#377](databricks/databricks-sql-nodejs#377) → [#379](databricks/databricks-sql-nodejs#379) → [#382](databricks/databricks-sql-nodejs#382) → [#381](databricks/databricks-sql-nodejs#381) → [#384](databricks/databricks-sql-nodejs#384) → [#383](databricks/databricks-sql-nodejs#383) (tip). **Policy:** new PRs always stack on the current tip. No sibling/parallel topology. No force-pushes on existing PRs unless absolutely necessary; if a PR's content is wrong, add a fix-up commit on top of the stack tip rather than rewriting history. --- **This PR is position 3/8.** ##⚠️ Must merge together with PR #29 In isolation, this PR ships a known cancel-lifecycle bug: the first call to `Statement.cancel()` from JS returns `KernelError(InvalidStatementHandle)` instead of cancelling the in-flight statement. **Root cause** — `Connection::execute_statement` (`napi/src/connection.rs:99-104`) builds a local kernel `Statement`, awaits `stmt.execute()`, hands the resulting `ExecutedStatement` to the JS-side `Statement` wrapper, then drops the parent kernel `Statement` at end of the closure. The kernel's `Drop for Statement` (`src/statement/mutable.rs:440-450`) calls `valid.invalidate()` on the shared `ValidityFlag`. The next `Statement.cancel()` from JS reaches `ExecutedStatement::cancel()` → `self.valid.check()` → `KernelError(InvalidStatementHandle)`. **Fix** — PR [#29](#29) (next in the stack) wraps the inner state in a `StatementInner { _parent: KernelStatement, executed: ExecutedStatement }` struct that keeps the parent alive for the wrapper's lifetime. With #29 applied, the cancel lifecycle works correctly on the first call. **Stack-merge policy** — these two PRs must merge as a pair (default Github stacked-PR flow handles this). Do not merge #25 to main without #29 in the same merge train. Reviewers approving #25 in isolation should approve #29 as part of the same approval pass. ## Summary Adds the four user-facing `#[napi]` classes that expose the kernel's v0 surface to JS consumers. ~504 LOC across 4 files plus a 4-line `lib.rs` update to declare the new modules. **Classes:** - `Database` — `Database.open()` returns a Session handle - `Connection` — `Connection.execute_statement()` returns a Statement handle - `Statement` — `fetchNextBatch()` / `schema()` / `cancel()` / `close()` - `ResultStream` (internal) — used by Statement; not directly exposed Results cross the FFI as Arrow IPC bytes (see `result.rs`); the TS adapter decodes via `apache-arrow`. Together with the skeleton PR [#27](#27), this delivers the full Round 2 napi surface. ## Test plan - `cargo check -p databricks-sea-native` clean - Downstream NodeJS `npm run build:native` produces a working `.node` artifact against this stack - Downstream OAuth M2M e2e green at `sea-auth-u2m@e7c979d` building against this binding ## Tracking - [PECOBLR-2670](https://databricks.atlassian.net/browse/PECOBLR-2670) — Make the async interface for rust kernel — napi classes - Parent epic: [PECOBLR-2666](https://databricks.atlassian.net/browse/PECOBLR-2666) Co-authored-by: Isaac [PECOBLR-2670]: https://databricks.atlassian.net/browse/PECOBLR-2670?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
vikrantpuppala
pushed a commit
that referenced
this pull request
May 26, 2026
…on (stack 4/8) (#29) ## Stack Linear stack of 8 PRs on `databricks/databricks-sql-kernel` landing the **SEA-driver kernel-side enablement** work. Merge in order from base ↑ to tip. The tip branch (`msrathore/krn-status-fields`, PR [#23](#23)) is the single snapshot containing every kernel-side change in flight. | Pos | PR | Branch | Scope | |---|---|---|---| | 1/8 | [#26](#26) | `kernel-async-public-api` | Remove `block_on` from ResultStream + Send-safety on Statement + rustls-tls + e2e test ported from [#20](#20) | | 2/8 | [#27](#27) | `kernel-napi-skeleton` | napi-rs binding crate skeleton: Cargo manifest + lib + error envelope + util + runtime + logger | | 3/8 | [#25](#25) | `kernel-napi-classes` | Database / Connection / Statement / ResultStream napi classes | | 4/8 | [#29](#29) | `kernel-napi-statement-validity` | StatementInner ValidityFlag fix propagated from sea-operation | | 5/8 | [#28](#28) | `kernel-oauth-error-class` | Reclassify OAuth token-exchange failures as `Error::unauthenticated()` (2-line fix in auth/oauth/m2m.rs + u2m.rs) | | 6/8 | [#30](#30) | `krn-connection-pool-default-bump` | Bump `HttpConfig.pool_max_idle_per_host` default from 10 → 100 | | 7/8 | [#24](#24) | `krn-tls-public-api` | Expose `TlsConfig` fields (custom_ca_cert + accept_self_signed + skip_hostname_verification) + stop discarding in session.rs | | 8/8 | [#23](#23) | `krn-status-fields` **← TIP** | Expose 5 status accessors on `ExecutedStatement` (num_modified_rows / progress / display_message / diagnostic_info / error_details_json) | **Companion NodeJS stack** (`databricks/databricks-sql-nodejs`): 8 PRs — root [#378](databricks/databricks-sql-nodejs#378) (sea-abstraction) → [#380](databricks/databricks-sql-nodejs#380) → [#377](databricks/databricks-sql-nodejs#377) → [#379](databricks/databricks-sql-nodejs#379) → [#382](databricks/databricks-sql-nodejs#382) → [#381](databricks/databricks-sql-nodejs#381) → [#384](databricks/databricks-sql-nodejs#384) → [#383](databricks/databricks-sql-nodejs#383) (tip). **Policy:** new PRs always stack on the current tip. No sibling/parallel topology. No force-pushes on existing PRs unless absolutely necessary; if a PR's content is wrong, add a fix-up commit on top of the stack tip rather than rewriting history. --- **This PR is position 4/8.** ## Why this PR is structurally required (not redundant with PR #25) Reviewers may notice this PR's diff against the new PR [#25](#25) tip looks like a follow-up nicety — it is not. It is a **correctness fix** for a real lifecycle bug PR #25 ships in isolation. **The bug** — PR #25's `Connection::execute_statement` builds a local kernel `Statement`, awaits `stmt.execute()`, hands the resulting `ExecutedStatement` to the JS-side `Statement` wrapper, then drops the parent kernel `Statement` at end of the closure. The kernel's `Drop for Statement` (`src/statement/mutable.rs:440-450`) calls `valid.invalidate()` on the shared `ValidityFlag` between the parent and the executed handle. The next `Statement.cancel()` from JS reaches `ExecutedStatement::cancel()` → `self.valid.check()` → `KernelError(InvalidStatementHandle)` — the **first** cancel call is broken. **The fix** — this PR wraps the inner state in `StatementInner { _parent: KernelStatement, executed: ExecutedStatement }`, keeping the parent alive for the JS wrapper's lifetime. The shared `ValidityFlag` stays set, so cancel works on the first call. **Stack-merge policy** — PR #25 and this PR must merge as a pair (default Github stacked-PR flow handles this). The PR #25 description carries a corresponding warning. Do not merge #25 to main without this PR in the same merge train. No new tests are added here — the closed-state assertions on PR #25's `Statement::cancel()` pin the typed-error contract for the parent-dropped case, and the cancel-after-completion idempotency tests pin the JDBC contract. Both continue to pass on the merged state. End-to-end cancel-during-fetch coverage is tracked as part of the lock-shape refactor follow-up at `sea-workflow/jira-candidates/2026-05-24-napi-cancel-during-fetch.md`. ## Summary Ports the StatementInner ValidityFlag fix from the NodeJS sea-operation worktree into the kernel-side napi crate (~89 LOC, 2 files). Adds the parent-Statement-keep-alive wrapper to `napi::Statement`'s inner state so the executed handle's `ValidityFlag` stays set for the JS wrapper's lifetime. The fix was originally authored downstream in the NodeJS worktree's vendored napi copy; landing it on the kernel-side napi crate keeps the two consistent until D-006 consolidation closes the vendoring gap. ## Test plan - `cargo test` clean (24/24 lib tests pass against the merged PR #25 + #29 state) - Downstream NodeJS `sea-operation` feature already validates the fix in JS-side unit tests ## Tracking - [PECOBLR-2917](https://databricks.atlassian.net/browse/PECOBLR-2917) — Fix napi binding SIGSEGV — StatementInner ValidityFlag - Parent epic: [PECOBLR-2666](https://databricks.atlassian.net/browse/PECOBLR-2666) Co-authored-by: Isaac [PECOBLR-2917]: https://databricks.atlassian.net/browse/PECOBLR-2917?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
msrathore-db
force-pushed
the
msrathore/kernel-oauth-error-class
branch
from
May 26, 2026 09:46
09472d7 to
17772cf
Compare
msrathore-db
added a commit
that referenced
this pull request
May 26, 2026
…ted (stack 5/8) (#28) ## Stack Linear stack of 8 PRs on `databricks/databricks-sql-kernel` landing the **SEA-driver kernel-side enablement** work. Merge in order from base ↑ to tip. The tip branch (`msrathore/krn-status-fields`, PR [#23](#23)) is the single snapshot containing every kernel-side change in flight. | Pos | PR | Branch | Scope | |---|---|---|---| | 1/8 | [#26](#26) | `kernel-async-public-api` | Remove `block_on` from ResultStream + Send-safety on Statement + rustls-tls + e2e test ported from [#20](#20) | | 2/8 | [#27](#27) | `kernel-napi-skeleton` | napi-rs binding crate skeleton: Cargo manifest + lib + error envelope + util + runtime + logger | | 3/8 | [#25](#25) | `kernel-napi-classes` | Database / Connection / Statement / ResultStream napi classes | | 4/8 | [#29](#29) | `kernel-napi-statement-validity` | StatementInner ValidityFlag fix propagated from sea-operation | | 5/8 | [#28](#28) | `kernel-oauth-error-class` | Reclassify OAuth token-exchange failures as `Error::unauthenticated()` (2-line fix in auth/oauth/m2m.rs + u2m.rs) | | 6/8 | [#30](#30) | `krn-connection-pool-default-bump` | Bump `HttpConfig.pool_max_idle_per_host` default from 10 → 100 | | 7/8 | [#24](#24) | `krn-tls-public-api` | Expose `TlsConfig` fields (custom_ca_cert + accept_self_signed + skip_hostname_verification) + stop discarding in session.rs | | 8/8 | [#23](#23) | `krn-status-fields` **← TIP** | Expose 5 status accessors on `ExecutedStatement` (num_modified_rows / progress / display_message / diagnostic_info / error_details_json) | **Companion NodeJS stack** (`databricks/databricks-sql-nodejs`): 8 PRs — root [#378](databricks/databricks-sql-nodejs#378) (sea-abstraction) → [#380](databricks/databricks-sql-nodejs#380) → [#377](databricks/databricks-sql-nodejs#377) → [#379](databricks/databricks-sql-nodejs#379) → [#382](databricks/databricks-sql-nodejs#382) → [#381](databricks/databricks-sql-nodejs#381) → [#384](databricks/databricks-sql-nodejs#384) → [#383](databricks/databricks-sql-nodejs#383) (tip). **Policy:** new PRs always stack on the current tip. No sibling/parallel topology. No force-pushes on existing PRs unless absolutely necessary; if a PR's content is wrong, add a fix-up commit on top of the stack tip rather than rewriting history. --- **This PR is position 5/8.** ## Summary **Two-line fix.** Changes `Error::io()` → `Error::unauthenticated()` in two OAuth token-exchange catch arms: - `src/auth/oauth/m2m.rs:270` - `src/auth/oauth/u2m.rs:433` ## Why The previous classification surfaced OAuth credential rejections as a generic IO error → downstream JS `SeaErrorMapping` decoder produced `HiveDriverError`. The correct semantics are `AuthenticationError` (typed). This 2-line change unblocks the NodeJS M2M bad-secret e2e at `sea-auth-u2m@e7c979d` (which now correctly raises `instanceof AuthenticationError`). ## Deferred follow-up Precise classification of `oauth2::RequestTokenError` subtypes (5xx token-endpoint failures, transport errors → `NetworkError` instead of `Unauthenticated`). Tracked as NF3-1 in the NodeJS round-3 review chain; non-blocking today because JS-side retry policy isn't yet wired through SEA. ## Tracking - [PECOBLR-2878](https://databricks.atlassian.net/browse/PECOBLR-2878) — Error class hierarchy expansion — reclassify OAuth as Unauthenticated - Parent epic: [PECOBLR-2666](https://databricks.atlassian.net/browse/PECOBLR-2666) Co-authored-by: Isaac [PECOBLR-2878]: https://databricks.atlassian.net/browse/PECOBLR-2878?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
Matches the JDBC driver's `HttpConnectionPoolSize` default (100) and the kernel-internal `HttpClientConfig` default. Closes ~9x of the throughput gap with the NodeJS thrift driver's `maxSockets: Infinity` default for high-concurrency workloads (bursty parallel executeStatement, parallel CloudFetch chunk downloads). reqwest/hyper does not bound this; the prior 10 was a kernel-side conservative choice. Spec: sea-workflow/specs/07-errors-retries/connection-pool-default-mismatch.md Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
msrathore-db
force-pushed
the
msrathore/krn-connection-pool-default-bump
branch
from
May 26, 2026 09:57
c14c1ff to
a408cd5
Compare
msrathore-db
changed the base branch from
msrathore/kernel-oauth-error-class
to
main
May 26, 2026 09:57
Collaborator
Author
|
Closing — superseded by the configurable-per-binding approach. The kernel default |
msrathore-db
added a commit
that referenced
this pull request
May 26, 2026
Make the binding-specific default explicit instead of relying on the kernel core's HttpConfig::default() — that default stays at the conservative kernel value (10), and each binding chooses its own user-facing default when constructing the session. The napi binding's default is 100, matching the JDBC driver's HttpConnectionPoolSize and closing the throughput gap vs the NodeJS Thrift driver's maxSockets: Infinity for bursty workloads (concurrent executeStatement, parallel CloudFetch chunk downloads). Encoded as the public NAPI_DEFAULT_POOL_MAX_IDLE_PER_HOST constant so reviewers and downstream binding authors can see the per-binding default policy. The pyo3 binding inherits the kernel default of 10 (matching Python urllib3's maxsize=10). Supersedes the closed PR #30 which would have lifted the kernel default itself — that conflated 'napi wants 100' with 'every kernel consumer wants 100', and the per-binding split is the right shape. Co-authored-by: Isaac Signed-off-by: Madhavendra Rathore <madhavendra.rathore@databricks.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack
Linear stack of 8 PRs on
databricks/databricks-sql-kernellanding the SEA-driver kernel-side enablement work. Merge in order from base ↑ to tip. The tip branch (msrathore/krn-status-fields, PR #23) is the single snapshot containing every kernel-side change in flight.kernel-async-public-apiblock_onfrom ResultStream + Send-safety on Statement + rustls-tls + e2e test ported from #20kernel-napi-skeletonkernel-napi-classeskernel-napi-statement-validitykernel-oauth-error-classError::unauthenticated()(2-line fix in auth/oauth/m2m.rs + u2m.rs)krn-connection-pool-default-bumpHttpConfig.pool_max_idle_per_hostdefault from 10 → 100krn-tls-public-apiTlsConfigfields (custom_ca_cert + accept_self_signed + skip_hostname_verification) + stop discarding in session.rskrn-status-fields← TIPExecutedStatement(num_modified_rows / progress / display_message / diagnostic_info / error_details_json)Companion NodeJS stack (
databricks/databricks-sql-nodejs): 8 PRs — root #378 (sea-abstraction) → #380 → #377 → #379 → #382 → #381 → #384 → #383 (tip).Policy: new PRs always stack on the current tip. No sibling/parallel topology. No force-pushes on existing PRs unless absolutely necessary; if a PR's content is wrong, add a fix-up commit on top of the stack tip rather than rewriting history.
This PR is position 6/8.
Summary
Bumps the default of
HttpConfig::pool_max_idle_per_hostfrom 10 to 100 (~3 LOC of substantive change + a test).Why
thrift NodeJS uses Node's
http.Agent({ maxSockets: Infinity })by default — effectively unbounded connections per host. The Rust kernel defaultspool_max_idle_per_hostto 10. On high-concurrency NodeJS-SEA workloads, SEA caps connections at 10 while thrift saturates the host. Closing this gap by bumping to 100 gives ~9× throughput headroom on parallel-query workloads without exposing a new public field.Phase 2 (separate work) will promote
pool_max_idle_per_hostto a user-tunable JS-side option via the napi binding; spec'd indriver.md#27.Changes
src/config.rs: default value bumped from 10 → 100; docstring updatedsrc/config.rs:617-622: new testhttp_config_default_pool_max_idle_per_host_is_100verifies the new defaultTest plan
cargo test --lib --workspace http_config_default_pool— 1/1 passingcargo test --lib --workspace— full lib suite still green (1 pre-existing PEM flake D-016 unrelated)cargo clippy --all-targets -- -D warningscleanSpec
07-errors-retries/connection-pool-default-mismatch.md— full rationale + Phase 1/Phase 2 plan.Tracking
Co-authored-by: Isaac