thswlsqls opened a new issue, #17232:
URL: https://github.com/apache/iceberg/issues/17232

   **Apache Iceberg version**
   main @ 3038fde68
   
   **Query engine**
   N/A — engine-agnostic test fixture
   
   **Please describe the bug**
   `RESTCatalogServer.stop()` only stops the Jetty `httpServer`; the backend 
`Catalog` created in `initializeBackendCatalog()` (a `Closeable` `JdbcCatalog` 
by default, holding a JDBC connection pool and `FileIO`) is never closed.
   Offending code: `RESTCatalogServer.stop()` 
(`open-api/src/testFixtures/java/org/apache/iceberg/rest/RESTCatalogServer.java`
 line 137-141).
   `RESTCatalogAdapter.close()` 
(`core/src/test/java/org/apache/iceberg/rest/RESTCatalogAdapter.java` line 
680-685) documents that "the calling test is responsible for closing the 
underlying catalog" — the server is that owner but does not do it.
   
   **Steps to reproduce**
   1. Call `new RESTCatalogServer(config).start(false)`.
   2. Call `server.stop()`.
   3. The backend `JdbcCatalog`'s JDBC connection pool and `FileIO` are still 
open.
   
   Expected: backend catalog is closed along with the server.
   Actual: backend catalog resources leak.
   
   `RESTServerExtension` (used as a class-level JUnit extension in the REST 
Compatibility Kit suite and in Spark 3.5/4.0/4.1 `TestBaseWithCatalog`) 
triggers this on every test class teardown.
   
   **Additional context**
   N/A.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to