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

Set up AsyncHttpClient to follow redirects #688

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 @@ -128,6 +128,7 @@ private AsyncHttpClient buildCloseableHttpClient(CoreConfiguration configuration
.setConnectTimeout(configuration.getAsyncHttpClientConnectionTimeoutMs())
.setRequestTimeout(configuration.getAsyncHttpClientRequestTimeoutMs())
.setReadTimeout(configuration.getAsyncHttpClientReadTimeoutMs())
.setFollowRedirect(configuration.getAsyncHttpClientFollowRedirect())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just curious how does redirect work for you in this case? This communication is from control plane to an agent which should not get a new IP in general.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. @timmartin-stripe I think we want to catch the location in which communication is coming in the opposite direction. From agent to master is where we run into real issues.

.build());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ public interface CoreConfiguration {
@Default("10000")
int getAsyncHttpClientReadTimeoutMs();

@Config("mantis.asyncHttpClient.followRedirect")
@Default("true")
boolean getAsyncHttpClientFollowRedirect();

@Config("mantis.leader.monitor.factory")
@Default("io.mantisrx.server.core.master.LocalLeaderFactory")
String getLeaderMonitorFactoryName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public class WorkerConfigurationWritable implements WorkerConfiguration {
int asyncHttpClientConnectionTimeoutMs;
int asyncHttpClientRequestTimeoutMs;
int asyncHttpClientReadTimeoutMs;
boolean asyncHttpClientFollowRedirect;
String leaderMonitorFactory;
String metricsCollectorClass;
String jobAutoscalerManagerClassName;
Expand Down Expand Up @@ -130,6 +131,11 @@ public int getMetricsPublisherFrequencyInSeconds() {
return this.metricsPublisherFrequencyInSeconds;
}

@Override
public boolean getAsyncHttpClientFollowRedirect() {
return this.asyncHttpClientFollowRedirect;
}

@Override
public String getLeaderMonitorFactoryName() {return this.leaderMonitorFactory;}

Expand Down
Loading