- which may lead to IllegalMonitorStateException in unlock() when unchecked error occurs during lock()master
@@ -127,8 +127,8 @@ public class ContextUtil { | |||
setNullContext(); | |||
return NULL_CONTEXT; | |||
} else { | |||
LOCK.lock(); | |||
try { | |||
LOCK.lock(); | |||
node = contextNameNodeMap.get(name); | |||
if (node == null) { | |||
if (contextNameNodeMap.size() > Constants.MAX_CONTEXT_NAME_SIZE) { | |||
@@ -101,8 +101,8 @@ public class ClusterNode extends StatisticNode { | |||
public Node getOrCreateOriginNode(String origin) { | |||
StatisticNode statisticNode = originCountMap.get(origin); | |||
if (statisticNode == null) { | |||
lock.lock(); | |||
try { | |||
lock.lock(); | |||
statisticNode = originCountMap.get(origin); | |||
if (statisticNode == null) { | |||
// The node is absent, create a new node for the origin. | |||