Skip to content

[SPARK-58021][CONNECT] Add local server pool storage model - #57685

Open
ericm-db wants to merge 2 commits into
apache:masterfrom
ericm-db:local-connect-pool-storage
Open

[SPARK-58021][CONNECT] Add local server pool storage model#57685
ericm-db wants to merge 2 commits into
apache:masterfrom
ericm-db:local-connect-pool-storage

Conversation

@ericm-db

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

This is layer 2 of the local Connect pool stack, following #57684.

It adds the filesystem-backed storage model for pool members:

  • stable member identities and state-file paths;
  • a per-pool cross-process file lock;
  • secure JSON state reads, writes, renames, and cleanup;
  • fingerprints for master, startup conf, working directory, and Python environment; and
  • FIFO claiming of reachable, version-compatible members.

Process lifecycle, acquisition, SparkSession integration, and JIT warmup remain in later PRs.

Why are the changes needed?

The pool needs a small, independently reviewable state model before adding process supervision and background launching. Keeping this layer limited to storage and claiming makes the concurrency contract and on-disk state transitions reviewable without the attendant implementation.

Does this PR introduce any user-facing change?

No. The storage model is internal and is not wired into SparkSession in this layer.

How was this patch tested?

Added seven focused tests in pyspark.sql.tests.connect.test_connect_local_server_pool.LocalConnectServerPoolUnitTests covering directory selection, pool-size parsing, zombie detection, fingerprint identity, FIFO claiming, fingerprint matching, and unreachable members.

python -m unittest -v pyspark.sql.tests.connect.test_connect_local_server_pool.LocalConnectServerPoolUnitTests

All 7 tests passed. Ruff check, Ruff format check, and git diff --check also passed.

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

Generated-by: Claude Code (Fable 5) and OpenAI Codex (GPT-5)

ericm-db added 2 commits July 31, 2026 16:54
Expose the per-user runtime directory and startup seed configuration, and let LocalConnectServer start isolated daemons with an ephemeral port and precomputed configuration. Keep persistent-server reuse on the same launch path and add focused unit coverage.
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