-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
upssched v2.8.0 hogs CPU after a while (Debian 12 package) #1964
Comments
jimklimov
added
bug
upssched
Questions and issues about upssched (timer helper for upsmon)
labels
Jun 13, 2023
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jun 13, 2023
…y (even if no formal errors are reported) [networkupstools#1964]
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jun 13, 2023
…ottle in case we have empty sock_read()s [networkupstools#1964]
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jun 13, 2023
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jun 14, 2023
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jun 14, 2023
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jun 15, 2023
…y (even if no formal errors are reported) [networkupstools#1964]
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jun 15, 2023
…ottle in case we have empty sock_read()s [networkupstools#1964]
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jun 15, 2023
jimklimov
added a commit
to jimklimov/nut
that referenced
this issue
Jun 15, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Raised in https://alioth-lists.debian.net/pipermail/nut-upsuser/2023-June/013338.html
Per initial analysis in the thread, it seems that the tight loop runs when
select()
returns quickly butread()
has nothing to report. Why - that is uncertain now. Possibly we miss the detection of a closed socket (disconnected client) and the raised "I am ready" flag is an attempt to convey that?..Might be or not be related to #1274 which landed a couple of months before NUT v2.8.0 release: not on first sight, but need a repro case to say for sure.
One easy-pickings solution (to CPU hogging) would be to detect that we spend almost no time in the loop to read nothing, and induce a delay (e.g.
select()
would have waited a second... might as well try tousleep()
the rest of it).However it is best to reproduce the problem and understand why it happens - if we lost the ability to forget disconnected clients, it is a path to resource leak and crash later on. And might be somehow related to other
upssched
issues reported over the past year or two...The text was updated successfully, but these errors were encountered: