private void releaseIdFromLocalPool(String parentPoolName, String localPoolName, String idKey)
throws ReadFailedException, IdManagerException {
String idLatchKey = idUtils.getUniqueKey(parentPoolName, idKey);
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Releasing ID {} from pool {}", idKey, localPoolName);
+ }
java.util.Optional.ofNullable(idUtils.releaseIdLatchMap.get(idLatchKey)).ifPresent(latch -> {
try {
- latch.await(5, TimeUnit.SECONDS);
+ latch.await(10, TimeUnit.SECONDS);
} catch (InterruptedException ignored) {
LOG.warn("Thread interrupted while releasing id {} from id pool {}", idKey, parentPoolName);
} finally {
InstanceIdentifier<IdEntries> existingId = idUtils.getIdEntry(parentIdPoolInstanceIdentifier, idKey);
Optional<IdEntries> existingIdEntryObject = singleTxDB.syncReadOptional(CONFIGURATION, existingId);
if (!existingIdEntryObject.isPresent()) {
- throw new IdManagerException(
- String.format("Specified Id key %s does not exist in id pool %s", idKey, parentPoolName));
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Specified Id key {} does not exist in id pool {}", idKey, parentPoolName);
+ }
+ return;
}
IdEntries existingIdEntry = existingIdEntryObject.get();
List<Long> idValuesList = existingIdEntry.getIdValue();
import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
import org.opendaylight.genius.idmanager.IdUtils;
import org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.id.pools.id.pool.IdEntries;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class UpdateIdEntryJob implements Callable<List<ListenableFuture<Void>>> {
+ private static final Logger LOG = LoggerFactory.getLogger(UpdateIdEntryJob.class);
private final String parentPoolName;
private final String localPoolName;
private final String idKey;
tx.delete(CONFIGURATION, idUtils.getIdEntriesInstanceIdentifier(parentPoolName, idKey));
}
tx.submit().checkedGet();
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Updated id entry with idValues {}, idKey {}, pool {}", newIdValues, idKey, localPoolName);
+ }
String uniqueIdKey = idUtils.getUniqueKey(parentPoolName, idKey);
Optional.ofNullable(idUtils.releaseIdLatchMap.get(uniqueIdKey))
.ifPresent(latch -> latch.countDown());