From 445b3dab61de73054a33fd5b4b80ec3f8417c339 Mon Sep 17 00:00:00 2001 From: Mohammad Salehe Date: Fri, 8 Feb 2019 11:45:25 -0500 Subject: Indicate failure in createLockReference 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 --- src/main/java/org/onap/music/service/impl/MusicCassaCore.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/onap/music/service/impl/MusicCassaCore.java b/src/main/java/org/onap/music/service/impl/MusicCassaCore.java index f6a563ca..1866a5c7 100644 --- a/src/main/java/org/onap/music/service/impl/MusicCassaCore.java +++ b/src/main/java/org/onap/music/service/impl/MusicCassaCore.java @@ -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"); -- cgit 1.2.3-korg