-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
prefetch: fix underlying unexpected-eof taken as EOF #59752
base: master
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @D3Hunter. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
@@ -87,13 +86,7 @@ func (r *concurrentFileReader) read(bufs [][]byte) ([][]byte, error) { | |||
buf, | |||
) | |||
if err != nil { | |||
log.FromContext(r.ctx).Error( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it prints too many logs when context cancel due to some goroutine in the same group failed, it's not needed, there is no further usefully info in it.
@@ -977,7 +983,7 @@ func (r *s3ObjectReader) Read(p []byte) (n int, err error) { | |||
n, err = r.reader.Read(p[:maxCnt]) | |||
// TODO: maybe we should use !errors.Is(err, io.EOF) here to avoid error lint, but currently, pingcap/errors | |||
// doesn't implement this method yet. | |||
for err != nil && errors.Cause(err) != io.EOF && retryCnt < maxErrorRetries { //nolint:errorlint | |||
for err != nil && errors.Cause(err) != io.EOF && r.ctx.Err() == nil && retryCnt < maxErrorRetries { //nolint:errorlint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to retry on context cancel
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #59752 +/- ##
================================================
+ Coverage 72.9537% 74.6646% +1.7109%
================================================
Files 1697 1743 +46
Lines 468912 478514 +9602
================================================
+ Hits 342089 357281 +15192
+ Misses 105752 98695 -7057
- Partials 21071 22538 +1467
Flags with carried forward coverage won't be shown. Click here to find out more.
|
What problem does this PR solve?
Issue Number: ref #59495
Problem Summary:
What changed and how does it work?
the underlying reader might also return unexpected-eof, we need different between them, introduced in #59496
rangeSize
toprefetch.Reader
to determine whereUnexpectedEOF
comes fromgoerrors.Is
instead of==
. we might add stack to the error to help debugio.Reader
, we still follow the API definition to return theio.EOF
directly without stack, ourbyteReader
doesn't follow the API ofio.Reader
, so it's ok to add stack to the errorgoerrors.Is
to checkio.EOF
even for errors fromio.Reader
Check List
Tests
same test in #50451, before it will fail with unexpected-eof, now success
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.