Skip to content

fix(conformance): make namespace cleanup failures visible - #65

Merged
magnusp merged 1 commit into
mainfrom
fix/52-namespace-cleanup
Oct 21, 2026
Merged

magnusp merged 1 commit into
mainfrom
fix/52-namespace-cleanup

Conversation

@magnusp

@magnusp magnusp commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Closes #52. Part of #54.

What changed

  • XerialTestServer.releaseNamespace now checks the admin DELETE status. Transient responses (I/O, 408, 429, 5xx) are retried up to three times; any non-2xx response other than 404 is surfaced as an IllegalStateException.
  • A namespace whose delete failed is recorded as failed, and ensureNamespace refuses to reuse it. A 409 from namespace create is no longer treated as success, so a stale namespace cannot be silently adopted.
  • Cleanup failures during connect are attached as suppressed to the primary connection error.
  • NamespaceClosingHandler now releases on close, abort, and unwrap(Connection.class). unwrap returns the proxy so closing the unwrapped handle still releases, and release still runs if the underlying close/abort throws.
  • Vendored JSON1Test closes its per-test connection via @AfterEach; vendored CachedRowSetTest closes its connection with try-with-resources.
  • Updated upstream-xerial_sqlite-jdbc.manifest with the two divergence notes and CHECKSUMS.sha256 with the current hashes, using the mechanism from Vendoring checksums and manifest are not enforced #53. tools/export-upstream --verify passes.

Contract decision

Parity with xerial 3.53.4.0 at the pinned tag. The only deviations are the two vendored test edits, which are test-only and required by the Hrana namespace lifecycle: a sqld namespace lives until its last connection closes, so the upstream tests that leak connections would leak namespaces for the whole run.

Evidence

Failing before the fix (original cleanup behavior, with only the test seam in place):

./mvnw -pl libsql-conformance -am -Dit.test='XerialTestServerCleanupTest,NamespaceClosingHandlerTest' -DfailIfNoTests=false verify
...
[ERROR] Tests run: 9, Failures: 5, Errors: 1, Skipped: 0
[INFO] BUILD FAILURE

Failures covered failed-delete visibility, retry, 409 reuse, abort release, and unwrap release.

Passing after the fix:

./mvnw -pl libsql-conformance -am -Dit.test='XerialTestServerCleanupTest,NamespaceClosingHandlerTest' -DfailIfNoTests=false verify
[INFO] Tests run: 9, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS

Full verification:

./mvnw -pl libsql-jdbc -am test
[INFO] BUILD SUCCESS

./mvnw -pl libsql-conformance -am verify
[INFO] Tests run: 115, Failures: 0, Errors: 0, Skipped: 1
[INFO] BUILD SUCCESS

./mvnw spotless:apply
[INFO] BUILD SUCCESS

./tools/export-upstream --verify
Verified upstream-xerial_sqlite-jdbc against upstream-xerial_sqlite-jdbc.manifest

Deviations

The two vendored test edits above are the only deviations from the pinned xerial tag, and both are recorded in upstream-xerial_sqlite-jdbc.manifest with updated CHECKSUMS.sha256 current hashes. Runtime behavior is otherwise unchanged.

@magnusp
magnusp force-pushed the fix/52-namespace-cleanup branch 2 times, most recently from 5885b86 to 936cebe Compare October 21, 2026 22:15
@magnusp
magnusp force-pushed the fix/52-namespace-cleanup branch from 936cebe to 5fd4e07 Compare October 21, 2026 22:19
@magnusp
magnusp merged commit a8e4345 into main Oct 21, 2026
5 checks passed
@magnusp
magnusp deleted the fix/52-namespace-cleanup branch October 21, 2026 22:22
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.

Namespace cleanup ignores failures and can leak or reuse state

1 participant