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

Interrupt query yielding rows. #560

Merged
merged 5 commits into from
Feb 7, 2024

Conversation

MathieuBordere
Copy link
Contributor

@MathieuBordere MathieuBordere commented Feb 5, 2024

Allow to interrupt a query yielding rows, whereas in the past the interrupt request was only handled - after - all rows were returned.

To make this work I had to allow multiple pending writes to the transport because the query that's yielding rows is writing to the transport, but when an interrupt comes in, we also want the interrupt handler to be able to write to the transport. As long as messages are written as whole and uv_write_t doesn't interleave data of 2 writes [1] then this should be okay.

DRAFT: running tests and upstream tests and also want to check if I'm violating some assumptions by allowing multiple writes, basically checking [1].

EDIT: writes with uv_write_t are queued and execute in order, so multiple writes should be fine. dqlite also sends data with message granularity, so that should also be fine.

@MathieuBordere
Copy link
Contributor Author

please test downstream

Copy link

codecov bot commented Feb 5, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (71562ee) 61.29% compared to head (0976158) 61.31%.

Files Patch % Lines
src/conn.c 87.50% 0 Missing and 2 partials ⚠️
src/lib/transport.c 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #560      +/-   ##
==========================================
+ Coverage   61.29%   61.31%   +0.02%     
==========================================
  Files          34       34              
  Lines        6834     6838       +4     
  Branches     2031     2033       +2     
==========================================
+ Hits         4189     4193       +4     
+ Misses       1349     1345       -4     
- Partials     1296     1300       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MathieuBordere
Copy link
Contributor Author

please test downstream

@MathieuBordere MathieuBordere marked this pull request as ready for review February 6, 2024 11:53
@MathieuBordere MathieuBordere marked this pull request as draft February 6, 2024 12:09
@MathieuBordere MathieuBordere marked this pull request as ready for review February 6, 2024 12:19
src/conn.c Outdated Show resolved Hide resolved
src/lib/transport.c Outdated Show resolved Hide resolved
src/conn.c Show resolved Hide resolved
src/conn.h Outdated Show resolved Hide resolved
src/conn.c Outdated Show resolved Hide resolved
test/integration/test_client.c Show resolved Hide resolved
Mathieu Borderé added 5 commits February 7, 2024 15:40
Signed-off-by: Mathieu Borderé <mathieu.bordere@canonical.com>
Signed-off-by: Mathieu Borderé <mathieu.bordere@canonical.com>
Signed-off-by: Mathieu Borderé <mathieu.bordere@canonical.com>
Signed-off-by: Mathieu Borderé <mathieu.bordere@canonical.com>
Copy link
Contributor

@cole-miller cole-miller left a comment

Choose a reason for hiding this comment

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

Hooray!

@MathieuBordere MathieuBordere merged commit 4ca4dae into canonical:master Feb 7, 2024
12 checks passed
MathieuBordere pushed a commit to MathieuBordere/dqlite that referenced this pull request Feb 9, 2024
cole-miller added a commit that referenced this pull request Feb 9, 2024
Revert "Merge pull request #560 from MathieuBordere/interrupt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants