Repository navigation
Clear cached Hadoop filesystems when a Spark JVM is reused by the next integration test module - #125448
Conversation
`test_storage_iceberg_concurrent/test_concurrent_reads.py::test_concurrent_reads` fails in `Integration tests (arm_binary[, distributed plan], 1/4)` on master since ClickHouse#120519 added `test_storage_delta/test_writes_interop.py`, the second Spark module that reads MinIO through `s3a://root`: https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=56e72cfad0e82b5dfd2e3be5202aff91757dc920&name_0=MasterCI&name_1=Integration%20tests%20%28arm_binary%2C%20distributed%20plan%2C%201%2F4%29 https://s3.amazonaws.com/clickhouse-test-reports/praktika.html?REF=master&sha=360bb0de656eb8f83cea4ca307f8480348494eb4&name_0=MasterCI&name_1=Integration%20tests%20%28arm_binary%2C%201%2F4%29 `ResilientSparkSession` reuses a live py4j gateway, so one pytest worker keeps one JVM across modules. Hadoop caches `FileSystem` instances JVM-wide by scheme and authority only, and `SparkSession.stop()` does not clear them, so the iceberg session got the interop module's `S3AFileSystem` for `s3a://root`, still bound to the interop cluster's MinIO, while its own configuration named its own MinIO. In 32 CI jobs carrying both modules, the iceberg test failed 7/7 times when it ran on the same xdist worker after the interop module, and passed 25/25 times on a different worker. In the failed job on 56e72cf, the interop MinIO's released address 172.16.2.4 went to another module's MinIO at 13:56:53Z, Spark's Iceberg metadata write landed there, and ClickHouse's `CREATE TABLE` 6 s later reported Code 107 against its own MinIO. Call `FileSystem.closeAll()` when reusing a live JVM with no active context. The JVM is still reused, so the reuse contract of `test_spark_session_recovery` is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Internal second-model review: adjudication log (click to expand)Pre-publication review by an independent model (engine: codex; 1 finding) plus my own review (3 nits).
Severity: ❌ blocker / Session id: cron:clickhouse-review-slot-9:20261012-151300 |
Pre-PR validation gate (click to expand)
Session id: cron:clickhouse-impl-slot-5:20261012-144600 |
|
Workflow [PR], commit [8058af9] Summary: ✅ AI ReviewSummaryThis PR clears Hadoop Final Verdict
|
…m-stale-s3a-filesystem
CI finish ledger - 7fecf73Every failure below has an owner: a fixing PR (mine or external), or a full-effort fix task
CIDB has no other Session id: cron:our-pr-ci-monitor:20261012-190013 |
The only failure on the previous head was test_storage_iceberg_concurrent/test_concurrent_reads (arm_binary), fixed on master by ClickHouse#125448. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Related: #120519
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Integration tests:
ResilientSparkSessionnow clears the JVM-wide HadoopFileSystemcache when it reuses a live Spark JVM, so a module's Spark session no longer gets the previous module'ss3a://filesystem bound to that module's MinIO.Description
test_storage_iceberg_concurrent/test_concurrent_reads.py::test_concurrent_readsfails on master inIntegration tests (arm_binary[, distributed plan], 1/4)since #120519 addedtest_storage_delta/test_writes_interop.py(report, report): either Code 107 (the Iceberg metadata file does not exist) or a failure inside Spark'sCREATE TABLE.ResilientSparkSessionreuses a live py4j gateway, so one pytest worker keeps one JVM across modules. Hadoop cachesFileSysteminstances JVM-wide, keyed by scheme, authority and user but not by configuration, andSparkSession.stop()does not clear them. The two modules are the only Spark users that read MinIO throughs3a://root, so when the interop module ran first on a worker, the iceberg session got itsS3AFileSystem, still bound to the interop cluster's MinIO. Across 32 CI jobs carrying both modules, the test failed 7/7 times on the same xdist worker as the interop module and passed 25/25 times on a different one.The change: when
_prepare_and_createreuses a live JVM with no active context, it callsFileSystem.closeAll()first. The JVM is still reused.Validation, local, on both runner images (Spark 3.5.5, which the failing jobs used, and Spark 4.0.0, which master uses now): a two-session probe in one process shows the second session's
S3AFileSystembound to the first endpoint before the change and to its own after it, with the same JVM. The real pair in one pytest process, with the two MinIOs on different addresses as in CI, failed 2/2 before and passed 3/3 after.test_spark_session_recoveryandtest_storage_iceberg_interoperability_azurepass.Workflow [PR]
Sync PR [sync-upstream/pr/125448]
Version info
26.10.1.2250-master(included in26.10and later)