-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
apcupsd-ups driver race condition #2007
Comments
Hi, trying to understand this better so reformatted your message for "screenshots" a bit. Did I understand correctly that with your testing script, you had lots of data for every once-a-second read from After the change of polling interval to "7", does the problem re-occur - e.g. every 7 minutes as the NUT query to From your description, my first guess would be that either:
Are you in position to try building NUT from sources and investigating the problem this way (adding more debug messages where you see fit, etc.)? |
Looking at v2.7.4...v2.8.0 (search down for |
So one suspect code could be in
previously it did not care about So indeed it first deletes all data not marked as "init" (and newly, neither marked as "preserved") and then goes to query For poll interval seems there is a genuine bug in
where newly added |
…ls#2007, networkupstools#797 fallout] Signed-off-by: Jim Klimov <[email protected]>
…pstools#797 fallout] Signed-off-by: Jim Klimov <[email protected]>
…pstools#2007] Signed-off-by: Jim Klimov <[email protected]>
…oleted readings AFTER refreshing data from apcupsd daemon [networkupstools#2007] Signed-off-by: Jim Klimov <[email protected]>
…FTER refreshing data from apcupsd daemon [networkupstools#2007] Signed-off-by: Jim Klimov <[email protected]>
Theorized a fix, proposed in #2010 If CI basically agrees it is buildable across the board, and if you have a chance to build it from https://github.com/jimklimov/nut/tree/issue-2007 e.g. per https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests to test (even if just from the build workspace) and report if it behaves better or explodes badly, that would be great. |
…rkupstools#2007, networkupstools#1777] Signed-off-by: Jim Klimov <[email protected]>
…stools#2007] Signed-off-by: Jim Klimov <[email protected]>
Hi:
I tried to modify apcupsd-ups.c and replace related line to old 2.8.0 version and let it run:
the new version seems fine. now the default and minimum polling interval is "10" seconds. and I can set the polling interval to "60" seconds. I try to execute "upsc myups" every second with default "10" seconds polling interval. there is no partial data after 10 minutes. I will let it run longer to make sure. currently I don't have APC ups nearby which can unplug the utility power. so I can not test the situation when the ups is on battery. thanks a lot for your quick fix! |
Sounds encouraging, thanks for the report and for the bug detection and fix proposal! :) |
I wonder if the |
…x expression [networkupstools#2007] Signed-off-by: Jim Klimov <[email protected]>
…etworkupstools#2007] Signed-off-by: Jim Klimov <[email protected]>
… we are deleting an entry because it is too old [networkupstools#2007] Signed-off-by: Jim Klimov <[email protected]>
Bumped the PR: gave a shot to the idea with parentheses above, and added logging (at verbosity level 6) to see if there were in fact some values not refreshed from If you'd check that this also works without surprises, would be great too :) |
Hi: |
…ls#2007, networkupstools#797 fallout] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
…pstools#797 fallout] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
…pstools#2007] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
…oleted readings AFTER refreshing data from apcupsd daemon [networkupstools#2007] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
…FTER refreshing data from apcupsd daemon [networkupstools#2007] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
…rkupstools#2007, networkupstools#1777] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
…stools#2007] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
…x expression [networkupstools#2007] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
…etworkupstools#2007] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
… we are deleting an entry because it is too old [networkupstools#2007] Signed-off-by: Jim Klimov <[email protected]> Signed-off-by: Alex W Baulé <[email protected]>
Hi:
we have more and more new APC ups which need to use nut apcupsd-ups driver (with serial modbus supported in apcupsd).
they work fine under nut 2.7.4, but it is not good under nut 2.8.0.
the difference is that the default nut apcupsd-ups driver polling interval is 60 seconds under 2.7.4 and change to 2 seconds under 2.8.0. the default normal polling interval settings for apcupsd is also 60 seconds. so nut 2.7.4 seems co-exist with apcupsd well.
we need to record the ups data like "ups.load" history so we use command "upsc myups" to read the data. and we found sometimes there are no "ups.load" data under 2.8.0. I write a little script and try to execute "upsc myups" every second and found it will fail to read the full data about 60 seconds interval. the normal full data for "upsc myups" is like below:
===================================================
when there is racing, "upsc myups" returns partial data like below:
===================================================
but the "apcaccess" of apcupsd is always correct like below:
===================================================
I found I can not set the apcupsd-ups polling interval back to "60" seconds under nut 2.8.0. the maximum value it will use is "10" seconds. current I can only set the polling interval to "7" seconds, since "7" is a prime number. it will has better common multiple with "60" seconds default with apcupsd.
The text was updated successfully, but these errors were encountered: