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

Fixed unexpected deletion of log files of other processes that led to OSError: [Errno 116] Stale file handle error on NFS volumes #8121

Merged
merged 4 commits into from
Jul 9, 2024

Conversation

azhavoro
Copy link
Contributor

@azhavoro azhavoro commented Jul 5, 2024

Due the nocleanup option defaults to false and we use AUTO-generated names for backend process log files, this causes NFS4ERR_STALE to appear on NFS-mounted volumes

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 109, in emit
    self.flush()
  File "/usr/lib/python3/dist-packages/supervisor/loggers.py", line 68, in flush
    self.stream.flush()
OSError: [Errno 116] Stale file handle

http://supervisord.org/configuration.html#:~:text=Introduced%3A%203.0-,nocleanup,-Prevent%20supervisord%20from
https://stackoverflow.com/questions/40262823/stale-file-handle-error-when-process-trying-read-the-file-that-other-process

Motivation and context

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

Summary by CodeRabbit

  • Improvements
    • Standardized log directory settings across various configurations for better readability and maintainability.
    • Added distinct stdout_logfile and stderr_logfile directives for more effective logging and troubleshooting across multiple programs.
    • Enabled automatic restart for specific worker programs to enhance reliability.

… OSError: [Errno 116] Stale file handle error on NFS volumes
@azhavoro azhavoro requested a review from SpecLad July 5, 2024 07:17
Copy link
Contributor

coderabbitai bot commented Jul 5, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The recent updates focus on standardizing the childlogdir settings and ensuring consistent logging mechanisms across various supervisor configuration files. These changes involve tidying up spacing issues and adding specific log file directives (stdout_logfile and stderr_logfile) for multiple programs. Additionally, some programs have also been configured for automatic restarts.

Changes

Files Change Summary
supervisord/server.conf Adjusted childlogdir spacing, added stdout_logfile and stderr_logfile for clamav_update and smokescreen programs.
supervisord/utils.conf Corrected childlogdir indentation; added logging directives for rqscheduler, rqworker-notifications, and rqworker-cleaning; set autorestart=true for rqworker-notifications and rqworker-cleaning.
supervisord/worker.analytics_reports.conf Adjusted childlogdir spacing; added stdout_logfile and stderr_logfile for logging.
supervisord/worker.annotation.conf Corrected childlogdir spacing; updated placeholders in stdout_logfile and stderr_logfile directives.
supervisord/worker.export.conf Adjusted childlogdir formatting; added stdout_logfile and stderr_logfile for rqworker-export.
supervisord/worker.import.conf Adjusted childlogdir formatting; added logging settings for stdout_logfile and stderr_logfile.
supervisord/worker.quality_reports.conf Corrected childlogdir formatting; added logging settings.
supervisord/worker.webhooks.conf Adjusted childlogdir spacing; added specific logging directives for rqworker-webhooks.

Poem

In logs and files where bytes do gleam,
The paths are tidy, as it may seem.
For every program, logs now flow,
In stdout and stderr, they now grow.
With spaces fixed, our configs bright,
Supervisor sings through day and night.
Restart, log, and dream anew,
A code-rabbit's touch in all we do.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c9f1cff and 89bcf19.

Files selected for processing (8)
  • supervisord/server.conf (2 hunks)
  • supervisord/utils.conf (3 hunks)
  • supervisord/worker.analytics_reports.conf (2 hunks)
  • supervisord/worker.annotation.conf (2 hunks)
  • supervisord/worker.export.conf (2 hunks)
  • supervisord/worker.import.conf (2 hunks)
  • supervisord/worker.quality_reports.conf (2 hunks)
  • supervisord/worker.webhooks.conf (2 hunks)
Files skipped from review due to trivial changes (5)
  • supervisord/server.conf
  • supervisord/worker.annotation.conf
  • supervisord/worker.import.conf
  • supervisord/worker.quality_reports.conf
  • supervisord/worker.webhooks.conf
Additional comments not posted (15)
supervisord/worker.analytics_reports.conf (3)

18-18: Good job on improving readability.

The added space before the comment delimiter improves readability and consistency.


28-28: Good addition for logging standard output.

The stdout_logfile directive ensures that the standard output logs are captured in a specific file.


29-29: Good addition for logging standard error.

The stderr_logfile directive ensures that the standard error logs are captured in a specific file.

supervisord/worker.export.conf (4)

18-18: Good job on improving readability.

The added space before the comment delimiter improves readability and consistency.


28-28: Good addition for logging standard output.

The stdout_logfile directive ensures that the standard output logs for rqworker-export are captured in a specific file.


29-29: Good addition for logging standard error.

The stderr_logfile directive ensures that the standard error logs for rqworker-export are captured in a specific file.


29-29: Good addition for logging standard error.

The stderr_logfile directive ensures that the standard error logs for rqworker-export are captured in a specific file.

supervisord/utils.conf (8)

18-18: Good job on improving readability.

The added space before the comment delimiter improves readability and consistency.


28-28: Good addition for logging standard output.

The stdout_logfile directive ensures that the standard output logs for rqscheduler are captured in a specific file.


29-29: Good addition for logging standard error.

The stderr_logfile directive ensures that the standard error logs for rqscheduler are captured in a specific file.


37-37: Good addition for logging standard output.

The stdout_logfile directive ensures that the standard output logs for rqworker-notifications are captured in a specific file.


38-38: Good addition for logging standard error.

The stderr_logfile directive ensures that the standard error logs for rqworker-notifications are captured in a specific file.


39-39: Good addition for ensuring program reliability.

The autorestart=true directive ensures that the rqworker-notifications program will automatically restart on unexpected termination.


49-49: Good addition for logging standard output.

The stdout_logfile directive ensures that the standard output logs for rqworker-cleaning are captured in a specific file.


50-50: Good addition for logging standard error.

The stderr_logfile directive ensures that the standard error logs for rqworker-cleaning are captured in a specific file.

@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 83.39%. Comparing base (bdd5535) to head (58ae2c6).
Report is 10 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8121      +/-   ##
===========================================
- Coverage    83.62%   83.39%   -0.23%     
===========================================
  Files          383      389       +6     
  Lines        40502    41297     +795     
  Branches      3830     3858      +28     
===========================================
+ Hits         33869    34441     +572     
- Misses        6633     6856     +223     
Components Coverage Δ
cvat-ui 79.66% <ø> (+0.01%) ⬆️
cvat-server 86.75% <ø> (-0.51%) ⬇️

supervisord/server.conf Outdated Show resolved Hide resolved
supervisord/server.conf Outdated Show resolved Hide resolved
@SpecLad
Copy link
Contributor

SpecLad commented Jul 5, 2024

Please add a changelog entry.

@azhavoro azhavoro requested a review from nmanovic as a code owner July 8, 2024 07:36
### Fixed

- Fixed unexpected deletion of log files of other processes that led to OSError:
\[Errno 116\] Stale file handle error on NFS volumes
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps it's worth mentioning that the logs are now saved in a different directory? This could be an unexpected change for users.

Copy link
Contributor

Choose a reason for hiding this comment

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

I added an extra entry to explain this.

Copy link

sonarcloud bot commented Jul 9, 2024

@SpecLad SpecLad merged commit ad1bcd5 into develop Jul 9, 2024
33 checks passed
@SpecLad SpecLad deleted the az/fix_logger_error branch July 9, 2024 12:35
@cvat-bot cvat-bot bot mentioned this pull request Jul 15, 2024
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.

None yet

3 participants