LuciferYang opened a new pull request, #14550: URL: https://github.com/apache/gravitino/pull/14550
### What changes were proposed in this pull request? With `gravitino.client.session.forwardUser=true`, a per-user Gravitino client is no longer closed while a transaction still uses it: - `getMetadata` leases the cached per-user session for the transaction. `commit` and a new `rollback` override release the transaction's leases; `rollback` is still not forwarded to the internal connector. - The cache's removal listener retires a session instead of closing its client. A retired session is closed when its last lease is released, or at once if no transaction holds it, and cannot be leased again. - `shutdown` releases the leases of open transactions. - `gravitino.client.session.cache.maxSize` and `gravitino.client.session.cache.expireAfterAccessSeconds` must now be positive. With 0 every call already failed, and with leases a lookup would never finish. ### Why are the changes needed? When another session evicted a user's client, or the client expired, during a transaction, the transaction's next Gravitino call failed with `Connection pool shut down`. Fix: #14549 ### Does this PR introduce _any_ user-facing change? A connector whose session cache size or expiry is 0 or negative now fails to load with a configuration error instead of failing every query. ### How was this patch tested? New cases in `TestGravitinoConnectorForwardUser`: - an evicted client stays open until its transaction commits or rolls back, and is then closed; - an evicted client that no transaction holds is closed at once, and a committed transaction leaves the cached client open for reuse; - a lease taken after the transaction has been rolled back is released, so the evicted client is still closed; - `shutdown` closes the clients of open transactions; - a session with two leases closes only after both are released; - a cache size or expiry of 0 fails at construction. -- 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]
