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

Avoid failing when the CPU period is zero #5

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

felipecrs
Copy link
Owner

And instead, fallback to counting CPUs from /proc/cpuinfo instead.

This situation is theoretically not possible, but it has happened as per:

@felipecrs felipecrs force-pushed the protect-against-period-as-zero branch from d4ab1db to 78da748 Compare September 4, 2024 02:59
@felipecrs
Copy link
Owner Author

felipecrs commented Sep 4, 2024

@christianonpele, I'm trying to understand the situation you described in:

Could you please run the following command within Frigate's container and paste the output here?

# example to get access to Frigate's container
$ docker exec -it frigate-container-name bash

$ curl -fsSL https://raw.githubusercontent.com/felipecrs/cgroup-scripts/78da74851849afa821488131a52e650cc6c6160c/get_cpus.sh | DEBUG=true sh

This would help me understand the issue better, and perhaps writing a better solution, as opposed to blindly add a protection for division by zero. Specially given this situation is theoretically not possible.

@felipecrs
Copy link
Owner Author

This was not tested against systems with cgroup v1, but it should work.

@felipecrs felipecrs merged commit b04ccde into master Sep 11, 2024
1 check passed
@felipecrs felipecrs deleted the protect-against-period-as-zero branch September 11, 2024 14:32
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.

1 participant