Skip to content

Commit

Permalink
Make sure sending cancel request in StatementClient.close()
Browse files Browse the repository at this point in the history
  • Loading branch information
takezoe committed Dec 7, 2024
1 parent 55c3bdc commit cd74922
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/trino/client/statement_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,11 @@ def cancel_leaf_stage
end

def close
return unless running?

@state = :client_aborted
return if finished? || query_failed? || client_aborted?

if running?
@state = :client_aborted
end

begin
if uri = @results.next_uri
Expand Down

0 comments on commit cd74922

Please sign in to comment.