-
Notifications
You must be signed in to change notification settings - Fork 77
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: remove new exceptions #326
Conversation
@@ -274,15 +266,15 @@ def close(self): | |||
self._connection._iprot.trans.close() | |||
except Exception as e: | |||
logger.error( | |||
'Close connection to {}:{} failed:{}'.format(self._ip, self._port, e) | |||
"Close connection to {}:{} failed:{}".format(self._ip, self._port, e) |
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.
please ignore formatter's change, sorry
nebula3/gclient/net/Session.py
Outdated
@@ -25,6 +25,7 @@ def __init__( | |||
auth_result: AuthResult, | |||
pool, | |||
retry_connect=True, | |||
retry_execute=False, |
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.
Let's make the execution error retry opt-in, thus to not surprise anyone.
nebula3/gclient/net/Session.py
Outdated
@@ -35,7 +36,8 @@ def __init__( | |||
:param auth_result: The result of the authentication process. | |||
:param pool: The pool object where the session was created. | |||
:param retry_connect: A boolean indicating whether to retry the connection if it fails. | |||
:param retry_times: The number of times to retry the connection. | |||
:param retry_execute: A boolean indicating whether to retry the execution if got execution error(-1005), by default False. | |||
:param retry_times: The number of times to retry the connection/execution. |
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.
maybe we don't need retry_execute param, 0 retry_times means no retry for execution. and mark retry_times default 0 to keep the same with no-retry mechanism.
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.
agree :), the retry times is already a newly introduced and it's feasible to be as flag with 0 value, done
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #326 +/- ##
==========================================
- Coverage 77.23% 76.90% -0.33%
==========================================
Files 18 18
Lines 2530 2516 -14
==========================================
- Hits 1954 1935 -19
- Misses 576 581 +5 ☔ View full report in Codecov by Sentry. |
What type of PR is this?
What problem(s) does this PR solve?
Issue(s) number: #325