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** # Conflicts: # spring-integration-core/src/test/java/org/springframework/integration/util/SimplePoolTests.java # Conflicts: # spring-integration-core/src/test/java/org/springframework/integration/util/SimplePoolTests.java # spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/CachingClientConnectionFactory.java # spring-integration-sftp/src/test/java/org/springframework/integration/sftp/inbound/SftpStreamingMessageSourceTests.java * Remove `default close()` from `Pool` interface * Cast to `SimplePool` in the `CSF` to call the new `close()`
This commit is contained in:
committed by
Artem Bilan
parent
a24f24fc6d
commit
c95e6dcc3b
@@ -128,7 +128,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