-
Notifications
You must be signed in to change notification settings - Fork 901
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
GODRIVER-2651 Break NoWritesPerformed-Only Error Sequence #1135
Conversation
if tt.HasErrorLabel(NoWritesPerformed) && !errors.Is(tt, prevIndefiniteErr) { | ||
err = prevIndefiniteErr | ||
|
||
goto checkError |
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.
For clarity, this "goto" is defensive. One of the conditions for setting the "prevIndefiniteError" is that it is not the same type of error as the one that is the subject of this switch condition: "tt". If that is the case, we need to repeat the switch block for the "previousIndefiniteError" so that it can run the logic for the correct case.
If the "previousIndefiniteError" is the same as "tt", then there is no need to entire this block and the error can continue with its processing.
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.
Thank you for the explanation. It makes sense.
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.
Looks good 👍
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 looks great to me!
if tt.HasErrorLabel(NoWritesPerformed) && !errors.Is(tt, prevIndefiniteErr) { | ||
err = prevIndefiniteErr | ||
|
||
goto checkError |
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.
Thank you for the explanation. It makes sense.
Co-authored-by: Qingyang Hu <103950869+qingyang-hu@users.noreply.github.com>
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.
One comment on a comment (lol) but otherwise logic LGTM.
Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>
Co-authored-by: Qingyang Hu <103950869+qingyang-hu@users.noreply.github.com> Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com> Co-authored-by: Kevin Albertson <kevin.albertson@mongodb.com> Co-authored-by: Qingyang Hu <103950869+qingyang-hu@users.noreply.github.com> Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com>
* GODRIVER-2651 Break NoWritesPerformed-Only Error Sequence (#1135) Co-authored-by: Qingyang Hu <103950869+qingyang-hu@users.noreply.github.com> Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com> Co-authored-by: Kevin Albertson <kevin.albertson@mongodb.com> Co-authored-by: Qingyang Hu <103950869+qingyang-hu@users.noreply.github.com> Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com> * GODRIVER-2333 Assert that Ping op succeeds initial DNS spec tests (#1124) * GODRIVER-2577 Retry heartbeat on timeout to prevent pool cleanup in FAAS pause. (#1133) * resolve merge conflicts Co-authored-by: Qingyang Hu <103950869+qingyang-hu@users.noreply.github.com> Co-authored-by: Benjamin Rewis <32186188+benjirewis@users.noreply.github.com> Co-authored-by: Kevin Albertson <kevin.albertson@mongodb.com>
GODRIVER-2651
Summary
When a "NoWritesPerformed" label is encountered, and the executor is out of retries, then we need to reset the error to the "previousIndefiniteError" and re-run the error check. This also needs to work for cases where the only errors that are returned are labeled "NoWritesPerformed"
Background & Motivation
There are two issues that were noted: