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

fix: IntermediateWriter closes underlying writer twice #3248

Merged
merged 2 commits into from Jan 26, 2024

Conversation

waynexia
Copy link
Member

I hereby agree to the terms of the GreptimeDB CLA

What's changed and what's your intention?

futures_util::forward() will flush and close the writer when stream is finished. From its document https://docs.rs/futures-util/0.3.30/futures_util/stream/trait.StreamExt.html#method.forward :

It will complete once the stream is exhausted, the sink has received and flushed all items, and the sink is closed.

Test can pass before because Vec won't report errors when it gets closed twice.

Checklist

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR does not require documentation updates.

Refer to a related PR or issue link (optional)

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
@github-actions github-actions bot added docs-not-required This change does not impact docs. Size: S labels Jan 26, 2024
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Copy link

codecov bot commented Jan 26, 2024

Codecov Report

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

Comparison is base (b0c3be3) 85.62% compared to head (95d484b) 85.17%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3248      +/-   ##
==========================================
- Coverage   85.62%   85.17%   -0.46%     
==========================================
  Files         856      856              
  Lines      140092   140107      +15     
==========================================
- Hits       119957   119334     -623     
- Misses      20135    20773     +638     

@waynexia waynexia added this pull request to the merge queue Jan 26, 2024
Merged via the queue into GreptimeTeam:main with commit 7da8f22 Jan 26, 2024
16 checks passed
@waynexia waynexia deleted the writer-close-twice branch January 26, 2024 10:17
shuiyisong pushed a commit to shuiyisong/greptimedb that referenced this pull request Jan 30, 2024
…3248)

* fix: IntermediateWriter closes underlying writer twice

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* close writer manually on error

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
shuiyisong pushed a commit to shuiyisong/greptimedb that referenced this pull request Jan 30, 2024
…3248)

* fix: IntermediateWriter closes underlying writer twice

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* close writer manually on error

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required This change does not impact docs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants