From 55b10104aaed66fa39a5a9f8b68a53635daf055f Mon Sep 17 00:00:00 2001 From: Kevin Woo Date: Fri, 3 Nov 2017 11:26:02 -0700 Subject: [PATCH] fix(UserRoleSyncer) add config timeout to agent polling (#203) We should wait until after the next poll cycle starts before another instance can try to run. https://github.com/spinnaker/fiat/pull/203 --- .../netflix/spinnaker/fiat/config/CatsSchedulerConfig.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fiat-roles/src/main/java/com/netflix/spinnaker/fiat/config/CatsSchedulerConfig.java b/fiat-roles/src/main/java/com/netflix/spinnaker/fiat/config/CatsSchedulerConfig.java index 9b1ae66e1..61af34b48 100644 --- a/fiat-roles/src/main/java/com/netflix/spinnaker/fiat/config/CatsSchedulerConfig.java +++ b/fiat-roles/src/main/java/com/netflix/spinnaker/fiat/config/CatsSchedulerConfig.java @@ -54,6 +54,9 @@ public class CatsSchedulerConfig { @Value("${fiat.writeMode.syncDelayMs:600000}") String syncDelayMs; + @Value("${fiat.writeMode.syncDelayTimeoutMs:30000}") + String syncDelayTimeoutMs; + @Bean NodeIdentity nodeIdentity() { return new DefaultNodeIdentity(); @@ -61,7 +64,9 @@ NodeIdentity nodeIdentity() { @Bean AgentIntervalProvider agentIntervalProvider() { - return new DefaultAgentIntervalProvider(Long.parseLong(syncDelayMs), 10000); + Long pollInterval = Long.parseLong(syncDelayMs); + Long timeout = Long.parseLong(syncDelayTimeoutMs); + return new DefaultAgentIntervalProvider(pollInterval, pollInterval + timeout); } @Bean