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 @@ -142,7 +142,7 @@ public void close() {
try {
terminated = delegate.awaitTermination(2, TimeUnit.SECONDS);
} catch (InterruptedException ex) {
// terminated will be false
Thread.currentThread().interrupt();
}
// Try hard to shutdown abruptly so any bug is more likely to be noticed during testing.
long quietPeriodSeconds = terminated ? 0 : 1;
Expand Down
15 changes: 12 additions & 3 deletions alts/src/main/java/io/grpc/alts/internal/AltsHandshakerClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ public ByteBuffer startClientHandshake() throws GeneralSecurityException {
logger.log(ChannelLogLevel.DEBUG, "Send ALTS handshake request to upstream");
resp = handshakerStub.send(req.build());
logger.log(ChannelLogLevel.DEBUG, "Receive ALTS handshake response from upstream");
} catch (IOException | InterruptedException e) {
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new GeneralSecurityException(e);
} catch (IOException e) {
throw new GeneralSecurityException(e);
}
handleResponse(resp);
Expand All @@ -201,7 +204,10 @@ public ByteBuffer startServerHandshake(ByteBuffer inBytes) throws GeneralSecurit
HandshakerResp resp;
try {
resp = handshakerStub.send(req.build());
} catch (IOException | InterruptedException e) {
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new GeneralSecurityException(e);
} catch (IOException e) {
throw new GeneralSecurityException(e);
}
handleResponse(resp);
Expand Down Expand Up @@ -231,7 +237,10 @@ public ByteBuffer next(ByteBuffer inBytes) throws GeneralSecurityException {
logger.log(ChannelLogLevel.DEBUG, "Send ALTS handshake request to upstream");
resp = handshakerStub.send(req.build());
logger.log(ChannelLogLevel.DEBUG, "Receive ALTS handshake response from upstream");
} catch (IOException | InterruptedException e) {
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new GeneralSecurityException(e);
} catch (IOException e) {
throw new GeneralSecurityException(e);
}
handleResponse(resp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,10 @@ static SslContext createForClient(
GetTlsConfigurationResp.ClientTlsConfiguration clientTlsConfiguration;
try {
clientTlsConfiguration = getClientTlsConfigurationFromS2A(stub, localIdentity);
} catch (IOException | InterruptedException e) {
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new GeneralSecurityException("Failed to get client TLS configuration from S2A.", e);
} catch (IOException e) {
throw new GeneralSecurityException("Failed to get client TLS configuration from S2A.", e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ private static <T> T getFuture(ListenableFuture<T> future) {
}
return ret;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw Status.INTERNAL.withCause(e).asRuntimeException();
} catch (ExecutionException e) {
throw Status.INTERNAL.withCause(e).asRuntimeException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ public void run() {
try {
return retVal.get();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(ERROR_MSG, e);
} catch (ExecutionException e) {
throw new RuntimeException(ERROR_MSG, e);
Expand All @@ -212,6 +213,7 @@ public void run() {
try {
return retVal.get();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(ERROR_MSG, e);
} catch (ExecutionException e) {
throw new RuntimeException(ERROR_MSG, e);
Expand Down Expand Up @@ -261,6 +263,7 @@ public void run() {
try {
return retVal.get();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(ERROR_MSG, e);
} catch (ExecutionException e) {
throw new RuntimeException(ERROR_MSG, e);
Expand All @@ -280,6 +283,7 @@ public void run() {
try {
return retVal.get();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(ERROR_MSG, e);
} catch (ExecutionException e) {
throw new RuntimeException(ERROR_MSG, e);
Expand Down
5 changes: 4 additions & 1 deletion xds/src/main/java/io/grpc/xds/XdsServerWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,10 @@ public void run() {
Exception exception;
try {
exception = initialStartFuture.get();
} catch (InterruptedException | ExecutionException e) {
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
if (exception != null) {
Expand Down
Loading