Skip to content

feat(kernel): wire ABI-version check, mTLS, and CloudFetch toggle options#410

Draft
mani-mathur-arch wants to merge 1 commit into
mani/sea-kernel-ctx-cancelfrom
mani/sea-kernel-tier2-features
Draft

feat(kernel): wire ABI-version check, mTLS, and CloudFetch toggle options#410
mani-mathur-arch wants to merge 1 commit into
mani/sea-kernel-ctx-cancelfrom
mani/sea-kernel-tier2-features

Conversation

@mani-mathur-arch

@mani-mathur-arch mani-mathur-arch commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

What

Wire the four new kernel C-ABI symbols on the driver side, extending the existing experimental-config surface:

  • checkABIVersion() — a sync.Once handshake at the top of OpenSession compares the linked library's kernel_abi_version() against the header macro and refuses to connect on a mismatch.
  • WithKernelClientCertificate(cert, key) — mTLS client identity via the paired setter. Both PEM halves required together (validateKernelConfig rejects an unpaired credential loudly); the key is never logged.
  • WithKernelCloudFetch(enabled) — a tri-state *bool (nil keeps the kernel default on; set forwards the toggle). Distinct from the plain-bool WithCloudFetch.

All three are kernel-only and rejected loudly on the Thrift path; the reflective classification guard is extended so a new experimental field can't ship unforwarded/unrejected. CloseSession stays fire-and-forget (adopting kernel_session_close_blocking would make close a blocking round-trip with no deadline — grouped with the cancellable-close follow-up).

Closes PECOBLR-3648 / 3652 / 3653 (driver side).

Stacked on #409 (mani/sea-kernel-ctx-cancel). Draft — CI build is red until KERNEL_REV is bumped to a merged kernel SHA carrying the new symbols.

Tests

  • Untagged: experimental-field classification guard + option→config wiring + Thrift fail-loud rejection + DeepCopy (all under CGO_ENABLED=0); mTLS-pairing validation.
  • Tagged: TestSetKernelTLS mTLS marshalling case, TestABIVersionMatches. Live-verified on staging (WithKernelCloudFetch(true) connects; (false) reaches the server and hits the documented CAN_CLOUD_DOWNLOAD gate). Default build unchanged.

Co-authored-by: Isaac

…ions

Wire the four new kernel C-ABI symbols on the driver side, extending the
existing experimental-config surface:

  - checkABIVersion(): a sync.Once handshake at the top of OpenSession compares
    the linked library's kernel_abi_version() against the header's
    DATABRICKS_KERNEL_ABI_VERSION and refuses to connect on a mismatch, so a
    differently-built prebuilt .a can't be silently misread.
  - WithKernelClientCertificate(cert, key): mTLS client identity forwarded via
    the paired kernel_session_config_set_tls_client_certificate. Both PEM halves
    are required together — validateKernelConfig rejects an unpaired credential
    loudly so a lone key can't be silently dropped — and the key is never logged.
  - WithKernelCloudFetch(enabled): a tri-state *bool (nil keeps the kernel
    default on; set forwards kernel_session_config_set_cloudfetch_enabled).
    Distinct from the plain-bool WithCloudFetch, whose unset state can't be told
    from false.

All three are kernel-only and rejected loudly on the Thrift path (the connector
fails when KernelExperimental is non-nil). The reflective classification guard is
extended so a new experimental field can't ship unforwarded/unrejected.

CloseSession stays fire-and-forget: the C ABI now also offers
kernel_session_close_blocking, but adopting it would make close a blocking
network round-trip with no deadline honored, so swapping to it is grouped with
the cancellable-close follow-up.

Requires the kernel ABI-version / mTLS / CloudFetch symbols; bump KERNEL_REV to
the merged kernel revision before this builds in CI (it links a locally-staged
archive today).

Tests: experimental-field classification guard + option wiring + Thrift
rejection + DeepCopy (untagged); TestSetKernelTLS mTLS case, TestABIVersionMatches,
and mTLS-pairing validation (tagged / config). Default CGO_ENABLED=0 build
unchanged.

Co-authored-by: Isaac
Signed-off-by: Mani Kaustubh Mathur <mani.mathur@databricks.com>
@mani-mathur-arch
mani-mathur-arch force-pushed the mani/sea-kernel-tier2-features branch from a067a22 to c54f051 Compare July 16, 2026 15:13
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