Skip to content
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

feat: renew session for expiration, re-execute when error #306

Conversation

wey-gu
Copy link
Contributor

@wey-gu wey-gu commented Jan 8, 2024

close: #276

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number: #276

Description:

  • renew session when E_SESSION_INVALID or E_SESSION_TIMEOUT
  • re-execute for E_EXECUTION_ERROR.

other changes

CI changed: avoid using pdm install, this was due to since py3.12, future's installation requires setuptools but setuptools was removed and thus it requires explicit installation/dependency on setuptools, while, the setuptools version cannot be resolved in py3.6.2+ actually, so we have to use pip install to mitigate this. (cc @frostming , I replaced pdm install with pip install, ping you to see if elegant way exists?)

@wey-gu wey-gu marked this pull request as draft January 8, 2024 11:25
@wey-gu wey-gu force-pushed the renew_session_and_reexecute_in_execution_error branch 3 times, most recently from bfb858a to 532e885 Compare January 8, 2024 12:54
@wey-gu wey-gu marked this pull request as ready for review January 8, 2024 13:09
@wey-gu wey-gu requested a review from Nicole00 January 8, 2024 13:09
@codecov-commenter
Copy link

codecov-commenter commented Jan 8, 2024

Codecov Report

Attention: Patch coverage is 61.90476% with 24 lines in your changes are missing coverage. Please review.

Project coverage is 77.50%. Comparing base (251c253) to head (54ba2c7).

Files Patch % Lines
nebula3/gclient/net/Session.py 50.00% 14 Missing ⚠️
nebula3/gclient/net/SessionPool.py 43.75% 9 Missing ⚠️
nebula3/gclient/net/Connection.py 83.33% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #306      +/-   ##
==========================================
- Coverage   77.83%   77.50%   -0.34%     
==========================================
  Files          18       18              
  Lines        2423     2485      +62     
==========================================
+ Hits         1886     1926      +40     
- Misses        537      559      +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wey-gu wey-gu force-pushed the renew_session_and_reexecute_in_execution_error branch 2 times, most recently from 051ecf2 to e5f4916 Compare January 10, 2024 08:31
@wey-gu wey-gu requested a review from Nicole00 January 10, 2024 10:27
except ExecutionErrorException as eee:
retry_count = 0
while retry_count < self._retry_times:
try:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sleep before retry execution.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done!

@wey-gu wey-gu force-pushed the renew_session_and_reexecute_in_execution_error branch from 84b7fa1 to adf40f0 Compare March 4, 2024 02:35
@wey-gu wey-gu requested a review from Nicole00 March 4, 2024 04:01
@Nicole00 Nicole00 merged commit f57b253 into vesoft-inc:master Mar 4, 2024
11 checks passed
@wey-gu wey-gu deleted the renew_session_and_reexecute_in_execution_error branch March 4, 2024 05:42
@wey-gu wey-gu mentioned this pull request Mar 16, 2024
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

renew Session for session expired & reconnect connection of session for IOError
3 participants