Fix CachedSessionFactory Race
Close the pool so that any sessions returned after the factory is `destroy()`ed are closed. * Call `removeAllIdleItems()` in `close()`. * Close sessions in `SftpStreamingMessageSourceTests`. **cherry-pick to all supported branches**
This commit is contained in:
@@ -137,7 +137,7 @@ public class CachingSessionFactory<F> implements SessionFactory<F>, DisposableBe
|
||||
*/
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.pool.removeAllIdleItems();
|
||||
this.pool.close();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user