impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabor Kaszab (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-1144: Fix exception when cancelling query in Impala-shell with CTRL-C
Date Sat, 18 Nov 2017 00:33:43 GMT
Gabor Kaszab has posted comments on this change. ( )

Change subject: IMPALA-1144: Fix exception when cancelling query in Impala-shell with CTRL-C

Patch Set 5:


We discussed this issue with Tim from a different angle with the following outcome:
- The only way to guarantee that there is no race condition around is_query_cancelled flag
is to Introduce locking around that variable.
- To make this work well the flag should be checked inside _do_rpc right before the rpc()
call. In addition the rpc() call itself should be protected by the same lock block we use
for is_query_cancelled check.
- Unfortunately, as a result cancelling a query would have to wait until the actual rpc()
call is finished. If it runs long then we've shot ourselves in the foot as the error wont
be shown at the end but the query cancellation would lag for long.

For a solution we considered a symptomatic treatment like approach to let the whole cancellation
race condition throw it's exception and then where we catch that exception we can decide to
suppress it or not.
Commit Message:
PS2, Line 25: Change-Id: I6cefaf1dae78baae238289816a7cb9d210fb38e2
> So, um, if you want a query that returns a lot of rows:
Thanks for the nice example, Phil!

I created a TC using your example and it seems to stably reproduce the issue. I wonder what
is the probability of this test to become flaky. (I executed it like 100 times and seems to
be still stable)
File shell/
PS3, Line 319:   def wait_to_finish(self, last_query_handle, periodic_callback=None):
> Do we also need to check is_cancelled here? In the case of a long-running D
PS3, Line 335:     """Fetch all the results.
> Why does this need to be set back to False? Seems confusing since the query
This in fact not needed here.
PS3, Line 355:         if not result.has_more:
> I think some of these other methods might also be subject to the same bug -
Good point, thx.

To view, visit
To unsubscribe, visit

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6cefaf1dae78baae238289816a7cb9d210fb38e2
Gerrit-Change-Number: 8549
Gerrit-PatchSet: 5
Gerrit-Owner: Gabor Kaszab <>
Gerrit-Reviewer: Attila Jeges <>
Gerrit-Reviewer: Csaba Ringhofer <>
Gerrit-Reviewer: David Knupp <>
Gerrit-Reviewer: Gabor Kaszab <>
Gerrit-Reviewer: Lars Volker <>
Gerrit-Reviewer: Laszlo Gaal <>
Gerrit-Reviewer: Michael Brown <>
Gerrit-Reviewer: Philip Zeyliger <>
Gerrit-Reviewer: Tim Armstrong <>
Gerrit-Reviewer: Zoltan Borok-Nagy <>
Gerrit-Comment-Date: Sat, 18 Nov 2017 00:33:43 +0000
Gerrit-HasComments: Yes

  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message