- isLockAcquired = routerLock.tryLock(routerName, LOCK_WAIT_TIME, TimeUnit.SECONDS);
- LOG.debug("Creating/Updating routerPorts node {} in floatingIpInfo DS for floating IP {} on fixed "
- + "neutron port {} : ", routerName, floatingIpAddress, fixedNeutronPortName);
- MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, routerPortsIdentifier,
- routerPortsBuilder.build());
- LOG.debug("FloatingIpInfo DS updated for floating IP {} ", floatingIpAddress);
+
+ try (AcquireResult lock = tryRouterLock(routerName)) {
+ if (!lock.wasAcquired()) {
+ // FIXME: why do we even bother with locking if we do not honor it?!
+ logTryLockFailure(routerName);
+ }
+
+ LOG.debug("Creating/Updating routerPorts node {} in floatingIpInfo DS for floating IP {} on fixed "
+ + "neutron port {} : ", routerName, floatingIpAddress, fixedNeutronPortName);
+ MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, routerPortsIdentifier,
+ routerPortsBuilder.build());
+ LOG.debug("FloatingIpInfo DS updated for floating IP {} ", floatingIpAddress);
+ }