Indicate failure in createLockReference 27/78127/2
authorMohammad Salehe <salehe@cs.toronto.edu>
Fri, 8 Feb 2019 16:45:25 +0000 (11:45 -0500)
committerMohammad Salehe <salehe@cs.toronto.edu>
Mon, 25 Feb 2019 03:23:38 +0000 (22:23 -0500)
We may not be able to create a lock reference temporarily.
We should indicate that by returning null, so the caller
can try again

Change-Id: If83567d64fd077b1a8eb39f66b8292c0ba6adefd
Issue-ID: MUSIC-148
Signed-off-by: Mohammad Salehe <salehe@cs.toronto.edu>
src/main/java/org/onap/music/service/impl/MusicCassaCore.java

index f6a563c..1866a5c 100644 (file)
@@ -116,7 +116,8 @@ public class MusicCassaCore implements MusicCoreService {
             try {
                 lockReference = "" + getLockingServiceHandle().genLockRefandEnQueue(keyspace, table, lockName, isWriteLock);
             } catch (MusicLockingException | MusicServiceException | MusicQueryException e) {
-                e.printStackTrace();
+                logger.info(EELFLoggerDelegate.applicationLogger, "Failed to create lock reference");
+                return null;
             }
             long end = System.currentTimeMillis();
             logger.info(EELFLoggerDelegate.applicationLogger, "Time taken to create lock reference:" + (end - start) + " ms");