Skip to content

Commit

Permalink
[FLINK-8063][QS] QS client does not retry when an UnknownKvStateLocat…
Browse files Browse the repository at this point in the history
…ion is thrown.
  • Loading branch information
kl0u committed Nov 17, 2017
1 parent 81dc260 commit a0838de
Show file tree
Hide file tree
Showing 3 changed files with 150 additions and 93 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ public void run() {
try {
stats.reportFailedRequest();

final String errMsg = "Failed request " + requestId + ". Caused by: " + ExceptionUtils.stringifyException(t);
final String errMsg = "Failed request " + requestId + "." + System.lineSeparator() + " Caused by: " + ExceptionUtils.stringifyException(t);
final ByteBuf err = MessageSerializer.serializeRequestFailure(ctx.alloc(), requestId, new RuntimeException(errMsg));
ctx.writeAndFlush(err);
} catch (IOException io) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
import org.apache.flink.runtime.query.KvStateClientProxy;
import org.apache.flink.runtime.query.KvStateLocation;
import org.apache.flink.runtime.query.KvStateMessage;
import org.apache.flink.runtime.query.UnknownKvStateLocation;
import org.apache.flink.runtime.state.KeyGroupRangeAssignment;
import org.apache.flink.util.Preconditions;

Expand All @@ -48,7 +47,6 @@

import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.util.concurrent.CancellationException;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
Expand Down Expand Up @@ -133,12 +131,11 @@ private void executeActionAsync(
operationFuture.whenCompleteAsync(
(t, throwable) -> {
if (throwable != null) {
if (throwable instanceof CancellationException) {
result.completeExceptionally(throwable);
} else if (throwable.getCause() instanceof UnknownKvStateIdException ||
if (
throwable.getCause() instanceof UnknownKvStateIdException ||
throwable.getCause() instanceof UnknownKvStateKeyGroupLocationException ||
throwable.getCause() instanceof UnknownKvStateLocation ||
throwable.getCause() instanceof ConnectException) {
throwable.getCause() instanceof ConnectException
) {

// These failures are likely to be caused by out-of-sync
// KvStateLocation. Therefore we retry this query and
Expand Down
Loading

0 comments on commit a0838de

Please sign in to comment.