Jason Fehr has posted comments on this change. ( http://gerrit.cloudera.org:8080/21803 )
Change subject: IMPALA-915: Support cancel queries in frontend ...................................................................... Patch Set 41: (7 comments) http://gerrit.cloudera.org:8080/#/c/21803/41/be/src/service/client-request-state.cc File be/src/service/client-request-state.cc: http://gerrit.cloudera.org:8080/#/c/21803/41/be/src/service/client-request-state.cc@256 PS41, Line 256: RETURN_IF_CANCELLED(this); In the ExecQueryOrDmlRequest function, RETURN_IF_CANCELLED happens after the query profile is updated. This function is returning before the query profile updates in the following lines. Should RETURN_IF_CANCELLED be called after line 292? The MarkActive() call would also have to be moved after the query profile updates. Not sure if that would impact anything. http://gerrit.cloudera.org:8080/#/c/21803/41/fe/src/main/java/org/apache/impala/service/Canceller.java File fe/src/main/java/org/apache/impala/service/Canceller.java: http://gerrit.cloudera.org:8080/#/c/21803/41/fe/src/main/java/org/apache/impala/service/Canceller.java@41 PS41, Line 41: public class Canceller { This class should enforce its design pattern by marking the class final and the constructor private. http://gerrit.cloudera.org:8080/#/c/21803/41/fe/src/main/java/org/apache/impala/service/Canceller.java@49 PS41, Line 49: private static Set<Thread> cancelledThreads_ = ConcurrentHashMap.newKeySet(); It may be possible to eliminate this class and use a ThreadLocal in Frontend.java instead. The ThreadLocal would track cancel status of the thread. A Map<TUniqueId, Thread> would still be needed so the correct thread could be interrupted. The Frontend#createExecRequest method would be responsible for updating the Map. http://gerrit.cloudera.org:8080/#/c/21803/41/fe/src/main/java/org/apache/impala/service/Canceller.java@94 PS41, Line 94: public static void cancel(TUniqueId queryId) { What happens if a query is cancelled twice with the second cancel coming in while the original cancel is in progress? http://gerrit.cloudera.org:8080/#/c/21803/41/fe/src/main/java/org/apache/impala/service/Canceller.java@132 PS41, Line 132: public static void lock(Lock lock) throws UserCancelledException { Is this method used? http://gerrit.cloudera.org:8080/#/c/21803/41/fe/src/main/java/org/apache/impala/service/Canceller.java@146 PS41, Line 146: public static <V extends Object> V getUninterruptibly(Future<V> future) Is this method used? http://gerrit.cloudera.org:8080/#/c/21803/41/tests/util/web_pages_util.py File tests/util/web_pages_util.py: http://gerrit.cloudera.org:8080/#/c/21803/41/tests/util/web_pages_util.py@61 PS41, Line 61: def get_queries(nth=0): Some of these functions are similar to existing functions in impala_service.py such as get_debug_webpage_json and wait_query_query_state -- To view, visit http://gerrit.cloudera.org:8080/21803 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I0d25d4c7fb0b8dcc7dad9510db1e8dca220eeb86 Gerrit-Change-Number: 21803 Gerrit-PatchSet: 41 Gerrit-Owner: Michael Smith <michael.sm...@cloudera.com> Gerrit-Reviewer: Andrew Sherman <asher...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Jason Fehr <jf...@cloudera.com> Gerrit-Reviewer: Joe McDonnell <joemcdonn...@cloudera.com> Gerrit-Reviewer: Michael Smith <michael.sm...@cloudera.com> Gerrit-Reviewer: Quanlong Huang <huangquanl...@gmail.com> Gerrit-Reviewer: Riza Suminto <riza.sumi...@cloudera.com> Gerrit-Comment-Date: Wed, 16 Apr 2025 17:57:49 +0000 Gerrit-HasComments: Yes