Skip to content

[KYUUBI #7511][SPARK] Start Spark Connect in the Spark SQL engine - #7670

Open
alexandrefimov wants to merge 2 commits into
apache:masterfrom
alexandrefimov:kyuubi-7511-connect-engine-start
Open

alexandrefimov wants to merge 2 commits into
apache:masterfrom
alexandrefimov:kyuubi-7511-connect-engine-start

Conversation

@alexandrefimov

@alexandrefimov alexandrefimov commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

Why are the changes needed?

Start Spark Connect alongside the Spark SQL engine's Thrift frontend as the first engine-side slice of Kyuubi issue 7511. Connect is disabled by default and controlled by the server. It requires authentication support and a token. Engines outside USER share level or with doAs disabled continue with Thrift only.

Discovery, Connect-aware lifecycle and generated per-engine tokens remain follow-ups. Deployments must use a Spark build containing the SPARK-58658 Config RPC fix.

How was this patch tested?

After merging master, Spark 3.5.8 / Scala 2.12 / JDK 17 and Spark 4.0.3 / Scala 2.13 / JDK 21 each passed 11 launcher tests, three server configuration tests and the generated settings check. The configuration tests used minimal Spark-home fixtures. dev/reformat passed. Full process-launch tests and a live Connect smoke still need a Spark distribution.

Was this patch authored or co-authored using generative AI tooling?

Assisted-by: Codex

@alexandrefimov

Copy link
Copy Markdown
Contributor Author

The one red check, Kyuubi and Spark Test (21, 3.11, 4.2, -Pscala-2.13, …), is HadoopCredentialsManagerSuite: schedule credentials renewal timing out: 0 did not equal 1 after 10 attempts over 1.1 seconds. That is the credentials renewal scheduler in kyuubi-server, while this PR touches the Spark engine module, KyuubiConf and SparkProcessBuilder — and the same job ran the new SparkConnectLauncherSuite green, 186 tests in that module. The neighbouring test in that suite already has a flaky-test issue, #2303.

Could someone re-run it? The (17, 3.11, 3.5, …mirror…) job was cancelled in the same run and needs the re-run too.

@alexandrefimov
alexandrefimov force-pushed the kyuubi-7511-connect-engine-start branch from 78ba18e to 9c595bc Compare August 31, 2026 19:27
The Spark SQL engine can serve Spark Connect clients next to its Thrift frontend.
Connect is started by configuration only - the plugin goes into spark.plugins and
the bound endpoint is read back reflectively - because io.grpc is relocated in
this module and a compile-time reference to SparkConnectService does not compile
here. That also keeps the default spark-3.5 build free of Connect classes.

Which engines serve Connect is decided in SparkProcessBuilder, where the values
are the server's own. kyuubi.engine.spark.connect.enabled is immutable, but the
engine rebuilds its KyuubiConf from every spark.kyuubi.* entry it is handed, so
the prefixed copy of that key is dropped from the engine's command line. An engine
that would not run as the session user - any share level but USER, or doAs
disabled - starts without Connect rather than failing, because a plan submitted
over Spark Connect runs as the user the engine runs as, not as the client's
user_id.

With Connect on, the engine still refuses to start when the runtime cannot
authenticate its clients - Spark 3.5 serves Connect with no authentication at all
- or when no token is configured: an endpoint that authenticates nobody is worse
than no endpoint. The Spark 4.0 requirement is a capability probe rather than a
version comparison.
@alexandrefimov
alexandrefimov force-pushed the kyuubi-7511-connect-engine-start branch from 9c595bc to f7ec0a3 Compare August 31, 2026 19:41
@alexandrefimov

Copy link
Copy Markdown
Contributor Author

@turboFei @pan3793, this is the first slice of #7511 — Spark Connect started inside the Spark SQL engine, next to the Thrift frontend. All 33 checks are green and no reviewers are assigned yet.

Could one of you take a look, or point me at who should?

@alexandrefimov

Copy link
Copy Markdown
Contributor Author

The only failing check is Spark 4.3 / JDK 25: AdminCtlSuite lists one engine immediately after deletion. The same test passes in that profile on the PR's base and two newer master commits. Could a committer rerun CI for this PR?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant