-
Notifications
You must be signed in to change notification settings - Fork 667
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
Use goto to cleanup error handling in readSyncBulkPayload #1332
Conversation
The goto error label is the same as the error return, use goto to reduce the references. ``` error: cancelReplicationHandshake(1); return; ``` Also this can make the log printing more continuous under the error, that is, we print the error log first, and then print the reconnecting log at the last (in cancelReplicationHandshake). Signed-off-by: Binbin <binloveplay1314@qq.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## unstable #1332 +/- ##
=========================================
Coverage 70.68% 70.69%
=========================================
Files 115 115
Lines 63177 63171 -6
=========================================
- Hits 44657 44656 -1
+ Misses 18520 18515 -5
|
a test log example:
the reconnecting and sync started should be after discarding one. |
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.
Makes sense.
The "Reconnecting" is logged by cancelReplicationHandshake.
cancelReplicationHandshake is a no-op in some cases where we just did return before, right?
no, cancelReplicationHandshake is not a no-op, and we are not just did return before, we did cancelReplicationHandshake and return together before, this commit just like, adjust the code location (or order). |
Ah, I see now. Every |
The goto error label is the same as the error return, use goto
to reduce the references.
Also this can make the log printing more continuous under the
error, that is, we print the error log first, and then print
the reconnecting log at the last (in cancelReplicationHandshake).