-
Notifications
You must be signed in to change notification settings - Fork 121
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
Improve harvester offline handling #164
Conversation
Split up the Windows and Linux/MacOS logic into separate consumers. Added `pygtail` to enable better log rotation handling. Pygtail does add an artefact file (`debug.log.offset`) to the `.chia/mainnet/log/` folder. This could potentially be moved to the chiadog folder if that's preferable. Added `retry` to catch Pygtail errors and retry Added `has_rotated` method which reads log filesize over SSH using Powershell
@ajacobson pinging you here as that might require some changes to Docker. We still need read-only access to the log file itself, but docker should be able to write a file in that same folder (can be temporary, not synced with host machine). Edit: @pieterhelsen mentioned this file can be moved to chiadog folder. Maybe that'll be preferable for the docker setup? |
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.
Great work 👍
I'll test the new Posix consumer today!
Does this resolve #72 🤔 |
Changes made: - Removed `paranoid` option from `Pygtail` - might not be required and requires considerable writes to disk. Should we still see 'harvester offline' false positives, this might be good to re-enable. - Re-added remote SSH port support - Miscellaneous cleanup
By default, Pygtail puts the offset file beside the file being tailed. The manual offset keeps this contained to the chiadog folder, which is better for (among others) the Docker container
Added the manual offset to write to within the chiadog root directory. Don't think there's any downsides and might be easier for Docker.
I sure hope so! |
This closes #134 |
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.
Thanks for addressing all feedback! Looking forward to see if this resolves the issues
* Add `pygtail` to enable better log rotation handling. It writes an artefact file (`debug.log.offset`) to the `chiadog` folder. * Add `retry` to catch Pygtail errors and retry * Add `has_rotated` method which reads log filesize over SSH using Powershell * Removed `paranoid` option from `Pygtail` - might not be required and requires considerable writes to disk. Should we still see 'harvester offline' false positives, this might be good to re-enable. * Remove OS-specific implementations of Local FileLogConsumer
Split up the Windows and Linux/MacOS logic into separate consumers.
Added
pygtail
for Posix and Windows local consumers to enable better log rotation handling. Pygtail does add an artefact file (debug.log.offset
) to the.chia/mainnet/log/
folder. This could potentially be moved to the chiadog folder if that's preferable.Added
retry
to catch Pygtail errors and retryAdded
has_rotated
method for Windows Network consumer which reads log filesize over SSH using PowershellLog output will look similar to this:
[2021-05-21 23:12:45] [ WARNING] --- [WinError 2] The system cannot find the file specified: 'C:\\Users\\PieterHelsen\\workspace\\debug.log', retrying in 2 seconds... (api.py:40)