VM creation fails with failed to allocate the nw 23/83023/9
authorKarthikeyan Krishnan <karthikeyangceb007@gmail.com>
Fri, 12 Jul 2019 06:55:46 +0000 (12:25 +0530)
committerAbhinav Gupta <abhinav.gupta@ericsson.com>
Fri, 20 Dec 2019 07:11:08 +0000 (07:11 +0000)
Issue:
======
VM creation fails with failed to allocate the
network error

Solution:
=========
Jstack output showed 8 L3 group installation DJC jobs on 8 CPUs waiting
indefinitely
for the group to get written on the switch.
This fix introduces a timed wait on the future so that other operations
can continue after the TimeOut and finally the DJC Thread can be released.

Change-Id: I6ffd61c7815bf5d82831c65064fbb1f749532b96
Signed-off-by: Karthikeyan Krishnan <karthikeyangceb007@gmail.com>
fibmanager/impl/src/main/java/org/opendaylight/netvirt/fibmanager/NexthopManager.java

index 00e65e658336a935e48f519ff89dc7ceaba08e1b..e08a34c54c70823ea9885fe7f87a4c4d3de56b0e 100644 (file)
@@ -27,7 +27,8 @@ import java.util.Objects;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.Future;
-
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
 import javax.annotation.PreDestroy;
 import javax.inject.Inject;
 import javax.inject.Singleton;
@@ -498,16 +499,18 @@ public class NexthopManager implements AutoCloseable {
         Future<RpcResult<AddGroupOutput>> groupStats = salGroupService.addGroup(input);
         RpcResult<AddGroupOutput> rpcResult = null;
         try {
-            rpcResult = groupStats.get();
+            rpcResult = groupStats.get(WAIT_TIME_FOR_SYNC_INSTALL, TimeUnit.MILLISECONDS);
             if (rpcResult != null && rpcResult.isSuccessful()) {
-                LOG.info("Group {} with key {} has been successfully installed directly on dpn {}.", groupId,
-                        nextHopKey, dpnId);
+                LOG.info("installGroupOnDpn: Group {} with key {} has been successfully installed directly on dpn {}.",
+                        groupId, nextHopKey, dpnId);
             } else {
-                LOG.error("Unable to install group {} with key {} directly on dpn {} due to {}.", groupId, nextHopKey,
-                        dpnId, rpcResult != null ? rpcResult.getErrors() : null);
+                LOG.error("installGroupOnDpn: Unable to install group {} with key {} directly on dpn {} due to {}.",
+                        groupId, nextHopKey, dpnId, rpcResult != null ? rpcResult.getErrors() : null);
             }
         } catch (InterruptedException | ExecutionException e) {
-            LOG.error("Error while installing group {} directly on dpn {}", groupId, dpnId);
+            LOG.error("installGroupOnDpn: Error while installing group {} directly on dpn {}", groupId, dpnId);
+        } catch (TimeoutException e) {
+            LOG.error("installGroupOnDpn: Group {} installation on dpn {} timed out.", groupId, dpnId);
         }
     }