Skip to content

Commit

Permalink
Reduce FileDownloader timeout in maintainer
Browse files Browse the repository at this point in the history
We don't know which config server has the file, so it's
better to have lower timeout and retry another server (also since
downloader does retries within timeout, might need to look into that).
  • Loading branch information
hmusum committed Dec 12, 2024
1 parent 68dde35 commit f076feb
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
public class ApplicationPackageMaintainer extends ConfigServerMaintainer {

private static final Logger log = Logger.getLogger(ApplicationPackageMaintainer.class.getName());
private static final Duration fileDownloaderTimeout = Duration.ofSeconds(30);

private final File downloadDirectory;
private final Supervisor supervisor = new Supervisor(new Transport("filedistribution-pool")).setDropEmptyBuffers(true);
Expand Down Expand Up @@ -126,7 +127,7 @@ private static FileDownloader createFileDownloader(ApplicationRepository applica
List<String> otherConfigServersInCluster = getOtherConfigServersInCluster(applicationRepository.configserverConfig());
ConfigSourceSet configSourceSet = new ConfigSourceSet(otherConfigServersInCluster);
ConnectionPool connectionPool = new FileDistributionConnectionPool(configSourceSet, supervisor);
return new FileDownloader(connectionPool, supervisor, downloadDirectory, Duration.ofSeconds(60));
return new FileDownloader(connectionPool, supervisor, downloadDirectory, fileDownloaderTimeout);
}

@Override
Expand Down

0 comments on commit f076feb

Please sign in to comment.