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: retry streaming methods if initial write errored #897

Merged
merged 2 commits into from Jan 24, 2020

Conversation

schmidt-sebastian
Copy link
Contributor

According to https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback, the write() callback may be called with an Error before on('error') is invoked. In this case, we should reject our Stream. In the current implementation, we would accept the Stream as healthy and then forward the error to the user, which prevents retries.

I noticed while looking at this code as we are porting it to Python

According to https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback, the write() callback may be called with an Error before on('error') is invoked. In this case, we should reject our Stream. In the current implementation, we would accept the Stream as healthy and then forward the error to the user, which prevents retries.

I noticed while looking at this code as we are porting it to Python
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 24, 2020
@schmidt-sebastian
Copy link
Contributor Author

FYI: There are no tests for now, since mocking this is pretty difficult. Feel free to push back :)

@codecov
Copy link

codecov bot commented Jan 24, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@4405062). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##             master    #897   +/-   ##
========================================
  Coverage          ?   96.6%           
========================================
  Files             ?      25           
  Lines             ?   15564           
  Branches          ?    1158           
========================================
  Hits              ?   15036           
  Misses            ?     519           
  Partials          ?       9
Impacted Files Coverage Δ
dev/src/serializer.ts 95.33% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4405062...abe6453. Read the comment docs.

@schmidt-sebastian schmidt-sebastian merged commit 2ec0489 into master Jan 24, 2020
@schmidt-sebastian schmidt-sebastian deleted the mrschmidt/errorhandling branch June 24, 2020 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants