Skip to content

Commit

Permalink
1. adjust server side's long polling timeout from 30 seconds to 60 se…
Browse files Browse the repository at this point in the history
…conds

2. adjust client side's long polling timeout from 600 seconds to 90 seconds
  • Loading branch information
nobodyiam committed Mar 17, 2018
1 parent 92ee12c commit bbdf8e5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public class RemoteConfigLongPollService {
private static final Joiner.MapJoiner MAP_JOINER = Joiner.on("&").withKeyValueSeparator("=");
private static final Escaper queryParamEscaper = UrlEscapers.urlFormParameterEscaper();
private static final long INIT_NOTIFICATION_ID = ConfigConsts.NOTIFICATION_ID_PLACEHOLDER;
//90 seconds, should be longer than server side's long polling timeout, which is now 60 seconds
private static final int LONG_POLLING_READ_TIMEOUT = 90 * 1000;
private final ExecutorService m_longPollingService;
private final AtomicBoolean m_longPollingStopped;
private SchedulePolicy m_longPollFailSchedulePolicyInSecond;
Expand Down Expand Up @@ -161,8 +163,7 @@ private void doLongPollingRefresh(String appId, String cluster, String dataCente

logger.debug("Long polling from {}", url);
HttpRequest request = new HttpRequest(url);
//longer timeout for read - 10 minutes
request.setReadTimeout(600000);
request.setReadTimeout(LONG_POLLING_READ_TIMEOUT);

transaction.addData("Url", url);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* @author Jason Song([email protected])
*/
public class DeferredResultWrapper {
private static final long TIMEOUT = 30 * 1000;//30 seconds
private static final long TIMEOUT = 60 * 1000;//60 seconds
private static final ResponseEntity<List<ApolloConfigNotification>>
NOT_MODIFIED_RESPONSE_LIST = new ResponseEntity<>(HttpStatus.NOT_MODIFIED);

Expand Down

0 comments on commit bbdf8e5

Please sign in to comment.