Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For stateful connections (FTP) limit to a maximum of 5 connections lo… #16471

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class DefaultSessionPool implements SessionPool {
private static final int POOL_WARNING_THRESHOLD = 5;

private final FailureDiagnostics<BackgroundException> diagnostics
= new DefaultFailureDiagnostics();
= new DefaultFailureDiagnostics();

private final ConnectionService connect;
private final TranscriptListener transcript;
Expand Down Expand Up @@ -154,9 +154,9 @@ public Session<?> borrow(final BackgroundActionState callback) throws Background
final BackgroundException failure = (BackgroundException) cause;
log.warn("Failure {} obtaining connection for {}", failure, this);
if(diagnostics.determine(failure) == FailureDiagnostics.Type.network) {
final int max = Math.max(1, pool.getMaxIdle() - 1);
log.warn("Lower maximum idle pool size to {} connections.", max);
pool.setMaxIdle(max);
final int max = Math.max(1, pool.getMaxTotal() - 1);
log.warn("Lower maximum total pool size to {} connections.", max);
pool.setMaxTotal(max);
// Clear pool from idle connections
pool.clear();
}
Expand Down
3 changes: 2 additions & 1 deletion defaults/src/main/resources/default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,8 @@ smb.protocol.negotiate.enable=true
# Session pool
connection.pool.minidle=1
connection.pool.maxidle=5
connection.pool.maxtotal=2147483647
connection.pool.maxtotal=5

# Default login name
connection.login.name=
connection.login.anon.name=anonymous
Expand Down