Closed timarmstrong closed 5 years ago
There's an equivalent HS2 method as well.
@intamyuto @paribhasha : For you to fix , depending on who gets to this first
@vishjosh I will have a look at this issue.
@intamyuto since you are already looking at the query error scenarios, can you please have a look at this issue as well? thanks.
fixed via #11
Well-behaved clients are expected to close queries via the close() method when they are done with them: https://github.com/apache/impala/blob/master/common/thrift/beeswax.thrift#L179. This releases all resources associated with the queries and generally avoids open queries from accumulating on the server.
I experimented with impala-go and it leaves all of the queries dangling until the client disconnects.
I0211 08:43:31.541136 30975 impala-server.cc:2012] Connection from client ::ffff:127.0.0.1:38950 closed, closing 1 associated session(s) I0211 08:43:31.541154 30975 impala-server.cc:1260] Closing session: d94d857aa1bb0ada:8732f4f69745269b I0211 08:43:31.541177 30975 impala-server.cc:1142] UnregisterQuery(): query_id=f84b83f4b6db701a:7457100f00000000 I0211 08:43:31.541182 30975 impala-server.cc:1249] Cancel(): query_id=f84b83f4b6db701a:7457100f00000000 I0211 08:43:31.541781 30975 impala-server.cc:1142] UnregisterQuery(): query_id=87424b90dbea4d1f:7796c34b00000000 I0211 08:43:31.541787 30975 impala-server.cc:1249] Cancel(): query_id=87424b90dbea4d1f:7796c34b00000000 I0211 08:43:31.542315 30975 impala-server.cc:1142] UnregisterQuery(): query_id=d24932ba436cdf1c:78fc87f000000000 I0211 08:43:31.542320 30975 impala-server.cc:1249] Cancel(): query_id=d24932ba436cdf1c:78fc87f000000000
I don't see any calls to close() in the source code of impala-go which explains that.
Unfortunately the contract around query unregistration is a little messy right now - in some cases, if the query encounters an error, it will return the error to the client on the next RPC and then automatically close the query. This only happens in some cases. I'd recommend calling close() and ignoring any QueryNotFoundException returned by close()