Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,17 @@ public Mono<Void> run(CancellationToken cancellationToken) {

CosmosException clientException = (CosmosException) throwable;
logger.warn(
"Lease with token " + this.lease.getLeaseToken() + ": CosmosException was thrown from thread " +
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using ShortMessage is fine for possibly noisy logs - see Exceptions.isCommonlyExpectedExceptionPossiblyCausingNoisyLogs for an example - but for unexpected errors the full diagnostics are crucial for being able to debug - so, please use the Exceptions.isCommonlyExpectedExceptionPossiblyCausingNoisyLogs to decide whether to use full or short message

Thread.currentThread().getId() + " for lease with owner " + this.lease.getOwner(),
clientException);
"Lease with token {}: CosmosException was thrown from thread {} for lease with owner {} {}",
this.lease.getLeaseToken(),
Thread.currentThread().getId(),
this.lease.getOwner(),
clientException.getShortMessage());
Comment on lines +201 to +205
if (logger.isDebugEnabled()) {
logger.debug(
"Lease with token " + this.lease.getLeaseToken() + ": CosmosException was thrown from thread " +
Thread.currentThread().getId() + " for lease with owner " + this.lease.getOwner(),
clientException);
Comment on lines +207 to +210
}
StatusCodeErrorType docDbError =
ExceptionClassifier.classifyClientException(clientException);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,18 @@ public Mono<Void> run(CancellationToken cancellationToken) {
// we know it is a terminal event.

CosmosException clientException = (CosmosException) throwable;
logger.warn("CosmosException: Partition " + this.lease.getLeaseToken()
+ " from thread " + Thread.currentThread().getId() + " with owner " + this.lease.getOwner(),
clientException);
logger.warn(
"CosmosException: partition {} from thread {} with owner {} {}",
this.lease.getLeaseToken(),
Thread.currentThread().getId(),
this.lease.getOwner(),
clientException.getShortMessage());
Comment on lines +211 to +216
if (logger.isDebugEnabled()) {
logger.debug(
"CosmosException: partition" + this.lease.getLeaseToken()
+ "from thread " + Thread.currentThread().getId() + " with owner " + this.lease.getOwner(),
clientException);
Comment on lines +218 to +221
}
StatusCodeErrorType docDbError = ExceptionClassifier.classifyClientException(clientException);

switch (docDbError) {
Expand Down
Loading