diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java index 7f3c2035e2ac52f37a9d870ad13e9ad214ec02f4..8408c044532d8107dcae4345409d16cf280f4a31 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java @@ -274,8 +274,8 @@ public class RemoteConfigRepository extends AbstractConfigRepository { logger.debug("Long polling from {}", url); HttpRequest request = new HttpRequest(url); - //no timeout for read - request.setReadTimeout(0); + //longer timeout for read - 1 minute + request.setReadTimeout(60000); transaction = Cat.newTransaction("Apollo.ConfigService", "pollNotification"); transaction.addData("Url", url); diff --git a/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/controller/NotificationController.java b/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/controller/NotificationController.java index 2b7341960b266854370ac06e6935ce210870660b..f2f63e7d51327383a1fc62e097a4bb2b93e6bd91 100644 --- a/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/controller/NotificationController.java +++ b/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/controller/NotificationController.java @@ -40,7 +40,7 @@ import java.util.Set; @RequestMapping("/notifications") public class NotificationController implements MessageListener { private static final Logger logger = LoggerFactory.getLogger(NotificationController.class); - private static final long TIMEOUT = 360 * 60 * 1000;//6 hours + private static final long TIMEOUT = 30 * 1000;//30 seconds private final Multimap>> deferredResults = Multimaps.synchronizedSetMultimap(HashMultimap.create()); private static final ResponseEntity