-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Explicitly check if we actually timed out #4132
Conversation
b.logger.Debugf("Browser:newPageInContext:<-ctx.Done", "tid:%v bctxid:%v err:%v", tid, id, ctx.Err()) | ||
} | ||
|
||
if err = ctx.Err(); err != nil { |
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.
Could this context be cancelled because any reason other than context.DeadlineExceeded
? Perhaps, in a future iteration of this code, we might want to introduce that explicit check or use cause.
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.
My understanding (@ankur22, please correct me if I am wrong) even if that happens it's still an error case
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.
Correct, any error from context is regarded as an error and we should return an error back to the user to notify them of an issue. If the context is closed at this point, it will mean that the iteration has ended.
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.
Right! What I was wondering is whether context.DeadlineExceeded
should be considered a timeout error, but context.Canceled
shouldn't (but as an unknown). But both errors, yeah.
ba9a7a7
ba9a7a7
to
92039a1
Compare
Nope, it's just GH UI tricked me |
What?
It's an attempt to address a nil pointer from #4128
Unfortunately, we don't have a script/steps to reproduce the #4128, but after analyzing the stack trace and code it seems like one of the possible scenarios what happens is that we reached the default (30s) context timeout which causing context deadline, somewhere down the
createWaitForEventHandler
it exits the releases the channel and as result we didn't fill the page.So we will always check the context error to check if it was timed out and also explicitly check if we were able to fetch non-nil page (the main purpose of the method)
Why?
Fix the panic and error explicit.
Checklist
make lint
) and all checks pass.make tests
) and all tests pass.Related PR(s)/Issue(s)
Fixes #4128