Skip to content

Commit

Permalink
[controller] Increase future timeout while fetching metadata (#861)
Browse files Browse the repository at this point in the history
Currently the mtadata fetch request from server times out sporadically due to low future.get timeout of 500ms. This PR increase that resolve those timeouts.


Co-authored-by: Sourav Maji <[email protected]>
  • Loading branch information
majisourav99 and Sourav Maji authored Feb 16, 2024
1 parent e0e56d3 commit 0763f64
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected StoreBackupVersionCleanupService(
});
Optional<SSLFactory> sslFactory = admin.getSslFactory();
this.httpAsyncClient = HttpAsyncClients.custom()
.setDefaultRequestConfig(RequestConfig.custom().setSocketTimeout(2000).build())
.setDefaultRequestConfig(RequestConfig.custom().setSocketTimeout(10000).build())
.setSSLContext(sslFactory.map(SSLFactory::getSSLContext).orElse(null))
.build();
}
Expand Down Expand Up @@ -152,7 +152,7 @@ private boolean validateAllRouterOnCurrentVersion(Store store, String clusterNam
try {
HttpGet routerRequest =
new HttpGet(routerInstance.getHostUrl(true) + TYPE_CURRENT_VERSION + "/" + store.getName());
HttpResponse response = getHttpAsyncClient().execute(routerRequest, null).get(500, TimeUnit.MILLISECONDS);
HttpResponse response = getHttpAsyncClient().execute(routerRequest, null).get(5000, TimeUnit.MILLISECONDS);
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
LOGGER.warn(
"Got status code {} from host {} while querying router current version for store {}",
Expand Down Expand Up @@ -189,7 +189,7 @@ private boolean validateAllServerOnCurrentVersion(Store store, String clusterNam
try {
HttpGet serverRequest = new HttpGet(
instance.getHostUrl(true) + QueryAction.CURRENT_VERSION.toString().toLowerCase() + "/" + store.getName());
HttpResponse response = getHttpAsyncClient().execute(serverRequest, null).get(500, TimeUnit.MILLISECONDS);
HttpResponse response = getHttpAsyncClient().execute(serverRequest, null).get(10000, TimeUnit.MILLISECONDS);
if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {
LOGGER.warn(
"Got status code {} from host {} while querying server current version for store {}",
Expand Down

0 comments on commit 0763f64

Please sign in to comment.