Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of interrupts in TrinoResultSet #14187

Merged
merged 2 commits into from
Sep 20, 2022

Conversation

findepi
Copy link
Member

@findepi findepi commented Sep 19, 2022

Differentiate between interrupts happening in the calling thread and
interrupts of the background thread.

  • use different message
  • the interrupts happening in the calling thread should result in full
    cancellation of the background thread. Previously they would close
    client, but wouldn't set cancelled flag.

@cla-bot cla-bot bot added the cla-signed label Sep 19, 2022
@findepi
Copy link
Member Author

findepi commented Sep 19, 2022

Currently based on #13775

@github-actions github-actions bot added the jdbc Relates to Trino JDBC driver label Sep 19, 2022
Differentiate between interrupts happening in the calling thread and
interrupts of the background thread.

- use different message
- the interrupts happening in the calling thread should result in full
  cancellation of the background thread. Previously they would close
  client, but wouldn't set `cancelled` flag.
@findepi findepi force-pushed the findepi/jdbc-interclean branch from 19ba980 to 3e01a3e Compare September 19, 2022 20:28
@findepi
Copy link
Member Author

findepi commented Sep 19, 2022

@xiacongling please take a look

@@ -183,7 +183,9 @@ public AsyncIterator(Iterator<T> dataIterator, StatementClient client)
}
}
catch (InterruptedException e) {
handleInterrupt(e);
client.close();
rowQueue.clear();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does cleaning rowQueue here matter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here it is probably not important. it's more like "why not?"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

discussed offline and agreed to keep

Copy link
Member

@losipiuk losipiuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xiacongling
Copy link
Contributor

LGTM. It is much clearer than before.

@findepi findepi merged commit 9485e42 into trinodb:master Sep 20, 2022
@findepi findepi deleted the findepi/jdbc-interclean branch September 20, 2022 10:06
@github-actions github-actions bot added this to the 397 milestone Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed jdbc Relates to Trino JDBC driver
Development

Successfully merging this pull request may close these issues.

3 participants