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

Fix: Set a non-zero polling internal when inotify cannot import #4230

Merged
merged 1 commit into from Sep 20, 2023

Conversation

stumpylog
Copy link
Member

Proposed change

Takes a chain:

  1. INotify import fails
  2. polling is set to 0 by default
  3. End up polling at 0 interval, using CPU forever

To prevent that, log a warning if inofity doesn't import, and reset to a default 10s polling interval if we reach polling with a 0 interval

Fixes #4226

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (please explain):

Checklist:

  • I have read & agree with the contributing guidelines.
  • If applicable, I have included testing coverage for new code in this PR, for backend and / or front-end changes.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
  • If applicable, I have checked that all tests pass, see documentation.
  • I have run all pre-commit hooks, see documentation.
  • I have made corresponding changes to the documentation as needed.
  • I have checked my modifications for any breaking changes.

@stumpylog stumpylog requested a review from a team as a code owner September 20, 2023 20:50
@github-actions github-actions bot added the bug Bug report or a Bug-fix label Sep 20, 2023
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #4230 (7fd0596) into dev (1ce0eae) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##              dev    #4230   +/-   ##
=======================================
  Coverage   95.42%   95.42%           
=======================================
  Files         344      344           
  Lines       13198    13199    +1     
  Branches     1076     1076           
=======================================
+ Hits        12594    12595    +1     
  Misses        599      599           
  Partials        5        5           
Flag Coverage Δ
backend 94.22% <100.00%> (+<0.01%) ⬆️
frontend 96.85% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
...documents/management/commands/document_consumer.py 94.02% <100.00%> (+0.02%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@shamoon shamoon left a comment

Choose a reason for hiding this comment

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

Thanks!

@shamoon shamoon merged commit 085e6da into dev Sep 20, 2023
31 checks passed
@shamoon shamoon deleted the fix/log-inotify-fails branch September 20, 2023 21:04
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backend bug Bug report or a Bug-fix small-change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Document consumer process causes permanent 100% CPU usage
2 participants