This commit is contained in:
David Noble 2019-05-23 14:42:00 -07:00
Родитель f73bce16e9
Коммит 77ee0481e3
2 изменённых файлов: 9 добавлений и 8 удалений

Просмотреть файл

@ -55,6 +55,7 @@ import java.util.concurrent.atomic.AtomicLong;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState; import static com.google.common.base.Preconditions.checkState;
import static com.microsoft.azure.cosmosdb.internal.directconnectivity.rntbd.RntbdReporter.reportIssueUnless;
@JsonSerialize(using = RntbdTransportClient.JsonSerializer.class) @JsonSerialize(using = RntbdTransportClient.JsonSerializer.class)
public final class RntbdTransportClient extends TransportClient implements AutoCloseable { public final class RntbdTransportClient extends TransportClient implements AutoCloseable {
@ -136,11 +137,9 @@ public final class RntbdTransportClient extends TransportClient implements AutoC
if (error == null) { if (error == null) {
emitter.onSuccess(response); emitter.onSuccess(response);
} else { } else {
if (!(error instanceof DocumentClientException)) { reportIssueUnless(error instanceof DocumentClientException, logger, requestRecord, "", error);
logger.warn("{} expected error of {}, not ", requestArgs, DocumentClientException.class, error);
}
this.metrics.incrementErrorResponseCount(); this.metrics.incrementErrorResponseCount();
emitter.onError(error instanceof CompletionException ? error.getCause() : error); emitter.onError(error);
} }
requestArgs.traceOperation(logger, null, "emitSingleComplete"); requestArgs.traceOperation(logger, null, "emitSingleComplete");

Просмотреть файл

@ -71,11 +71,13 @@ public final class RntbdRequestRecord extends CompletableFuture<StoreResponse> {
} }
public boolean expire() { public boolean expire() {
final RequestTimeoutException error = new RequestTimeoutException(
String.format("Request timeout interval (%,d ms) elapsed", final long timeoutInterval = this.timer.getRequestTimeout(TimeUnit.MILLISECONDS);
this.timer.getRequestTimeout(TimeUnit.MILLISECONDS)), final String message = String.format("Request timeout interval (%,d ms) elapsed", timeoutInterval);
this.args.getPhysicalAddress()); final RequestTimeoutException error = new RequestTimeoutException(message, this.args.getPhysicalAddress());
BridgeInternal.setRequestHeaders(error, this.args.getServiceRequest().getHeaders()); BridgeInternal.setRequestHeaders(error, this.args.getServiceRequest().getHeaders());
return this.completeExceptionally(error); return this.completeExceptionally(error);
} }