Increase timeout in config pusher for conflicting version ex 21/14121/2
authorMaros Marsalek <mmarsale@cisco.com>
Mon, 12 Jan 2015 09:00:27 +0000 (10:00 +0100)
committerMaros Marsalek <mmarsale@cisco.com>
Fri, 16 Jan 2015 08:26:03 +0000 (08:26 +0000)
Change-Id: Ie03354ec464f7f3e43a1df236d948533386484e1
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/ConfigPusherImpl.java
opendaylight/netconf/config-persister-impl/src/main/java/org/opendaylight/controller/netconf/persist/impl/osgi/ConfigPersisterActivator.java

index c20007d397b704b130d0ff7f281c5465588b44ff..cf9958e7f8abf44303aeb18f79a77d01b62d7a9b 100644 (file)
@@ -115,17 +115,20 @@ public class ConfigPusherImpl implements ConfigPusher {
      */
     private synchronized EditAndCommitResponse pushConfigWithConflictingVersionRetries(ConfigSnapshotHolder configSnapshotHolder) throws NetconfDocumentedException {
         ConflictingVersionException lastException;
-        Stopwatch stopwatch = new Stopwatch().start();
+        Stopwatch stopwatch = new Stopwatch();
         do {
             String idForReporting = configSnapshotHolder.toString();
             SortedSet<String> expectedCapabilities = checkNotNull(configSnapshotHolder.getCapabilities(),
                     "Expected capabilities must not be null - %s, check %s", idForReporting,
                     configSnapshotHolder.getClass().getName());
             try (NetconfOperationService operationService = getOperationServiceWithRetries(expectedCapabilities, idForReporting)) {
+                if(!stopwatch.isRunning()) {
+                    stopwatch.start();
+                }
                 return pushConfig(configSnapshotHolder, operationService);
             } catch (ConflictingVersionException e) {
                 lastException = e;
-                LOG.debug("Conflicting version detected, will retry after timeout");
+                LOG.info("Conflicting version detected, will retry after timeout");
                 sleep();
             }
         } while (stopwatch.elapsed(TimeUnit.MILLISECONDS) < conflictingVersionTimeoutMillis);
index 135d5ff9be8c765d4e52432e9f69a14179b0a51d..787f8b10b077612c544a6efcaad813c304ce0c9f 100644 (file)
@@ -41,7 +41,7 @@ public class ConfigPersisterActivator implements BundleActivator {
     public static final String MAX_WAIT_FOR_CAPABILITIES_MILLIS_PROPERTY = "maxWaitForCapabilitiesMillis";
     private static final long MAX_WAIT_FOR_CAPABILITIES_MILLIS_DEFAULT = TimeUnit.MINUTES.toMillis(2);
     public static final String CONFLICTING_VERSION_TIMEOUT_MILLIS_PROPERTY = "conflictingVersionTimeoutMillis";
-    private static final long CONFLICTING_VERSION_TIMEOUT_MILLIS_DEFAULT = TimeUnit.SECONDS.toMillis(30);
+    private static final long CONFLICTING_VERSION_TIMEOUT_MILLIS_DEFAULT = TimeUnit.MINUTES.toMillis(1);
 
     public static final String NETCONF_CONFIG_PERSISTER = "netconf.config.persister";