Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pool: close dcap accepter thread and server socket after client connects
Motivation: The first time a dcap client elects to transfer a file using "active mode" (client connecting to pool), the dcap mover will request a server socket and a thread be created to handle client connections. These resources are shared between successive "active" dcap movers, across all pools in the JVM. There is currently no mechanism to notify when the shared resources (the thread and socket) are no longer needed. This means that a pool that has been selected for an active dcap transfer will not shut down cleanly when notified, but requires the CellNucleus to interrupt the accepter thread using the fall-back mechanism. Modification: Update dcap mover to acquire a closeable object that represents the open server socket and accepter thread. The mover indicates when this is no longer needed by closing the object. A reference counter then allows the thread and server socket be closed when no longer needed. Result: Pools that have had an active transfers will close down without requiring the fallback. As a side-effect, a pool will keep the server socket open only as long as it is needed. Although the pool(s) will attempt to reuse the same port number over successive transfers, it is possible that the port number will change over time. Target: master Requires-notes: yes Requires-book: no Patch: https://rb.dcache.org/r/9673/ Acked-by: Tigran Mkrtchyan
- Loading branch information