[SPARK-57787][CONNECT][FOLLOWUP] Harden persistent local Connect server management - #57854
[SPARK-57787][CONNECT][FOLLOWUP] Harden persistent local Connect server management#57854cloud-fan wants to merge 3 commits into
Conversation
|
LGTM, thank you @cloud-fan |
|
Both hardenings are real improvements that match this feature's security model (loopback-only, same-user sharing), and treating a failed/timed-out
None of these are blockers. |
|
Thanks for the detailed review. I addressed the actionable points in c419b45:
Thanks again! |
What changes were proposed in this pull request?
Followup to #56907.
This change hardens persistent local Spark Connect server management in two ways. Before sending
SIGTERM, the client verifies that the PID recorded in discovery still belongs to
SparkConnectServer. If process inspection fails transiently, discovery is preserved so shutdown
can be retried. The launcher also removes inherited binding-address configuration and explicitly
binds the server to 127.0.0.1.
Why are the changes needed?
A stale discovery file can refer to a PID that the operating system has reused for an unrelated
process. Signaling that process would be unsafe. Separately, an inherited binding-address setting
can expose a server that is intended to remain local.
Does this PR introduce any user-facing change?
No. The persistent local server remains opt-in. The change only makes its shutdown and network
binding behavior safer.
How was this patch tested?
Added regression tests covering a reused PID, an inconclusive process probe, and forced loopback
binding. Ran:
All 16 tests passed.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Codex (GPT-5)