Skip to content

Improve handling of interrupts in TrinoResultSet#14187

Merged
findepi merged 2 commits intotrinodb:masterfrom
findepi:findepi/jdbc-interclean
Sep 20, 2022
Merged

Improve handling of interrupts in TrinoResultSet#14187
findepi merged 2 commits intotrinodb:masterfrom
findepi:findepi/jdbc-interclean

Conversation

@findepi
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

findepi commented Sep 19, 2022

@xiacongling please take a look

catch (InterruptedException e) {
handleInterrupt(e);
client.close();
rowQueue.clear();
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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