Skip to content

Commit cdf605b

Browse files
committed
NDC.pop() can return empty string, this causes a loop spinning in CallContext.UnregisterAll().
1 parent b21662f commit cdf605b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎api/src/org/apache/cloudstack/context/CallContext.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public static CallContext unregister() {
239239
String sessionIdOnStack = null;
240240
String sessionIdPushedToNDC = "ctx-" + UuidUtils.first(contextId);
241241
while ((sessionIdOnStack = NDC.pop()) != null) {
242-
if (sessionIdPushedToNDC.equals(sessionIdOnStack)) {
242+
if (sessionIdOnStack.isEmpty() || sessionIdPushedToNDC.equals(sessionIdOnStack)) {
243243
break;
244244
}
245245
if (s_logger.isTraceEnabled()) {

0 commit comments

Comments
 (0)