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>
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
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;
import javax.annotation.PreDestroy;
import javax.inject.Inject;
import javax.inject.Singleton;
Future<RpcResult<AddGroupOutput>> groupStats = salGroupService.addGroup(input);
RpcResult<AddGroupOutput> rpcResult = null;
try {
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()) {
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);
- 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) {
}
} 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);