-
Notifications
You must be signed in to change notification settings - Fork 62
Fix timeout error after 4h and improve log resumption #173 #178
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: master
Are you sure you want to change the base?
Conversation
|
Hi there, I wanted to check in on this PR to see if there’s any chance to get it reviewed or merged. Thanks a lot for your time, and please let me know if there’s anything I can adjust to help move it forward. |
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 PR fixes a timeout error that occurs after 4 hours by implementing periodic reconnections every 30 minutes and improving log resumption to avoid restarting from the beginning.
- Implements a 30-minute connection timeout with automatic reconnection
- Adds log line tracking to resume from the last processed line instead of restarting
- Introduces connection state management to control retry behavior during reconnections
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
|
|
||
| def wait(): | ||
| connection_max_time = 1800 # time in seconds |
Copilot
AI
Aug 26, 2025
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 magic number 1800 should be defined as a named constant (e.g., CONNECTION_TIMEOUT_SECONDS = 1800) to improve code maintainability and make the 30-minute timeout more explicit.
| connection_max_time = 1800 # time in seconds | |
| connection_max_time = CONNECTION_TIMEOUT_SECONDS |
|
|
||
| log.info("Waiting for job completion") | ||
| time.sleep(sleep) | ||
| if current_line_number > last_line_number or last_line_number == 0: |
Copilot
AI
Aug 26, 2025
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.
This condition will skip the first line when resuming (when last_line_number > 0). The condition should be 'current_line_number >= last_line_number' to avoid missing lines during log resumption.
| if current_line_number > last_line_number or last_line_number == 0: | |
| if current_line_number >= last_line_number: |
| last_line_number = current_line_number | ||
|
|
||
| current_line_number += 1 |
Copilot
AI
Aug 26, 2025
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 last_line_number is being set to current_line_number inside the if block, but current_line_number is incremented after this assignment. This will cause the next reconnection to skip one line. Move this assignment after the current_line_number increment or use current_line_number + 1.
| last_line_number = current_line_number | |
| current_line_number += 1 | |
| current_line_number += 1 | |
| last_line_number = current_line_number |
Fix timeout error after 4 hours and improve log resumption
Description:
Environment for Testing