Skip to content

Commit

Permalink
ISPN-2148 Improve lock timeout exception details
Browse files Browse the repository at this point in the history
  • Loading branch information
vblagoje authored and galderz committed Apr 15, 2014
1 parent 866225a commit 36d20f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,8 @@ private boolean lock(InvocationContext ctx, Object key, long timeoutMillis) thro
if (key instanceof MarshalledValue) {
key = ((MarshalledValue) key).get();
}
throw new TimeoutException("Unable to acquire lock after [" + Util.prettyPrintTime(timeoutMillis) + "] on key [" + key + "] for requestor [" +
ctx.getLockOwner() + "]! Lock held by [" + owner + "]");
throw log.unableToAcquireLock(Util.prettyPrintTime(timeoutMillis), key, ctx.getLockOwner(), owner,
ctx.getOrigin());
}
}

Expand Down
2 changes: 2 additions & 0 deletions core/src/main/java/org/infinispan/util/logging/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -1104,4 +1104,6 @@ void asyncStoreShutdownTimeoutTooHigh(long configuredAsyncStopTimeout,
@Message(value = "Starting a DefaultCacheManager with authorization enabled but without a SecurityManager installed may lead to unexpected behaviour", id = 298)
void authorizationEnabledWithoutSecurityManager();

@Message(value = "Unable to acquire lock after %s for key %s and requestor %s. Lock is held by %s, while request came from %s", id = 299)
TimeoutException unableToAcquireLock(String timeout, Object key, Object requestor, Object owner, Address origin);
}

0 comments on commit 36d20f6

Please sign in to comment.