[Nut-upsdev] [Nut-upsuser] Upssched 100% CPU after updating Debian 12
Sam Varshavchik
mrsam at courier-mta.com
Wed Jun 14 11:34:50 BST 2023
Jim Klimov via Nut-upsuser writes:
> So... determining that FD is to be reaped proved hard. Internet lore suggests
> fcntl() and poll() on the FD, but it just seems valid to them. The errno is
> also usually not raised (once I saw a "111: Connection refused" though).
> So the best dumb idea so far is to bail out if we spent the whole loop (128
> attempts) and only got zero-sized read replies and no errors.
It's been my experience, that the path of least resistance is:
1) The sockets are sets to be non-blocking
2) poll()
3) If poll() says the socket is readable, and read() returns <= 0, then the
socket is dead. You get no error, and read() returns 0, if the socket had an
orderly shutdown.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/nut-upsdev/attachments/20230614/7eb96efb/attachment.sig>
More information about the Nut-upsdev
mailing list