You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2022/04/15 12:46:39 UTC

[GitHub] [accumulo] dlmarion commented on a diff in pull request #2622: Handle thread interrupt in server client execute loop.

dlmarion commented on code in PR #2622:
URL: https://github.com/apache/accumulo/pull/2622#discussion_r851251266


##########
core/src/main/java/org/apache/accumulo/core/clientImpl/ServerClient.java:
##########
@@ -88,6 +88,9 @@ public static <T> T executeRaw(ClientContext context,
   public static <CT extends TServiceClient,RT> RT executeRaw(ClientContext context,
       TServiceClientFactory<CT> factory, ClientExecReturn<RT,CT> exec) throws Exception {
     while (true) {
+      if (Thread.currentThread().isInterrupted()) {

Review Comment:
   I made a comment with an alternate solution, but I think you want to call `Thread.interrupted` here as the Threads' interrupted state will be reset (to false) if it's true. https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Thread.html#interrupted()



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org