-
Notifications
You must be signed in to change notification settings - Fork 1
AK-DCON-763: Added logging for investigation #176
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This pull request adds temporary debugging logging to investigate connection issues in the retryable HTTP client. The changes introduce logging statements to track retry attempts and handle connection errors by recreating sessions when ClientError exceptions occur.
Key changes:
- Added debug logging to track retry counts and exception handling
- Implemented session recreation logic for ClientError exceptions to establish fresh connections
- Added detailed logging for different types of network exceptions
logging.warning(f"Connection reset/error detected: {e}. Attempt {retry_attempts+1}/{self.retries}") | ||
# Close existing session and create fresh one for new connection | ||
if self.session: | ||
await self.session.close() | ||
self.session = self.fn_get_session() | ||
else: | ||
logging.info(f"[TEST - 763] - Network error detected: {e}. Attempt {retry_attempts+1}/{self.retries}") |
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.
The retry attempt count is incorrect. At this point, retry_attempts
represents the current attempt (1-based), so retry_attempts+1
would show attempt 2/3 when actually on attempt 1/3. Use retry_attempts
instead of retry_attempts+1
.
logging.warning(f"Connection reset/error detected: {e}. Attempt {retry_attempts+1}/{self.retries}") | |
# Close existing session and create fresh one for new connection | |
if self.session: | |
await self.session.close() | |
self.session = self.fn_get_session() | |
else: | |
logging.info(f"[TEST - 763] - Network error detected: {e}. Attempt {retry_attempts+1}/{self.retries}") | |
logging.warning(f"Connection reset/error detected: {e}. Attempt {retry_attempts}/{self.retries}") | |
# Close existing session and create fresh one for new connection | |
if self.session: | |
await self.session.close() | |
self.session = self.fn_get_session() | |
else: | |
logging.info(f"[TEST - 763] - Network error detected: {e}. Attempt {retry_attempts}/{self.retries}") |
Copilot uses AI. Check for mistakes.
logging.warning(f"Connection reset/error detected: {e}. Attempt {retry_attempts+1}/{self.retries}") | ||
# Close existing session and create fresh one for new connection | ||
if self.session: | ||
await self.session.close() | ||
self.session = self.fn_get_session() | ||
else: | ||
logging.info(f"[TEST - 763] - Network error detected: {e}. Attempt {retry_attempts+1}/{self.retries}") |
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.
The retry attempt count is incorrect. At this point, retry_attempts
represents the current attempt (1-based), so retry_attempts+1
would show attempt 2/3 when actually on attempt 1/3. Use retry_attempts
instead of retry_attempts+1
.
logging.warning(f"Connection reset/error detected: {e}. Attempt {retry_attempts+1}/{self.retries}") | |
# Close existing session and create fresh one for new connection | |
if self.session: | |
await self.session.close() | |
self.session = self.fn_get_session() | |
else: | |
logging.info(f"[TEST - 763] - Network error detected: {e}. Attempt {retry_attempts+1}/{self.retries}") | |
logging.warning(f"Connection reset/error detected: {e}. Attempt {retry_attempts}/{self.retries}") | |
# Close existing session and create fresh one for new connection | |
if self.session: | |
await self.session.close() | |
self.session = self.fn_get_session() | |
else: | |
logging.info(f"[TEST - 763] - Network error detected: {e}. Attempt {retry_attempts}/{self.retries}") |
Copilot uses AI. Check for mistakes.
# Close existing session and create fresh one for new connection | ||
if self.session: | ||
await self.session.close() | ||
self.session = self.fn_get_session() |
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.
Creating a new session without awaiting the close operation could lead to resource leaks. The session.close()
call should be awaited before creating a new session to ensure proper cleanup.
self.session = self.fn_get_session() | |
self.session = await self.fn_get_session() |
Copilot uses AI. Check for mistakes.
Qodana Community for Python1 new problem were found
💡 Qodana analysis was run in the pull request mode: only the changed files were checked View the detailed Qodana reportTo be able to view the detailed Qodana report, you can either:
To get - name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2024.2.5
with:
upload-result: true Contact Qodana teamContact us at qodana-support@jetbrains.com
|
No description provided.