Skip to content

upsd: Revise chunked select from a swarm of client or driver connections#3367

Merged
jimklimov merged 10 commits intonetworkupstools:masterfrom
jimklimov:issue-3302
Mar 25, 2026
Merged

upsd: Revise chunked select from a swarm of client or driver connections#3367
jimklimov merged 10 commits intonetworkupstools:masterfrom
jimklimov:issue-3302

Conversation

@jimklimov
Copy link
Copy Markdown
Member

@jimklimov jimklimov commented Mar 23, 2026

Follow-up for #3302 and #3303.

Also revises upsdrvctl in WIN32 builds to WaitForSingleObject more diligently, honouring maxstartdelay same way POSIX code path does.

In common.c when logging is first called, switch stderr and stdout to line-buffered mode, for coherent logs on WIN32 (this belonged more in #3373 but oh well).

I think I've got why my earlier attempts at this failed. For one, chunked processing in Windows code path was not complete; for another - as it looped, it always waited for "up to POLL_TO" microseconds to see if any socket has buffered incoming data.

More thoughts and details at #3302 (comment)

CC @aarnold-sd68

@jimklimov jimklimov added this to the 2.8.5 milestone Mar 23, 2026
@jimklimov jimklimov added enhancement Connection stability issues Issues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over time labels Mar 23, 2026
@jimklimov
Copy link
Copy Markdown
Member Author

jimklimov commented Mar 23, 2026

@aarnold-sd68: Appveyor timed out, so retrying the build for you to have something to run: 2.8.4.4368-master

@AppVeyorBot
Copy link
Copy Markdown

@jimklimov jimklimov added C++ CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) SSL/NSS Issues and PRs about SSL, TLS and other crypto-related matters labels Mar 25, 2026
…rt to start hundreds of drivers to see what happens [networkupstools#3302]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…involved [networkupstools#3302]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…S_SWARM_COUNT [networkupstools#3302]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…Y_UPS_SWARM_COUNT>0 [networkupstools#3302]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ndows console

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…ts [networkupstools#3302]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…o timeout (pick already waiting connections), only then try time-waited select [networkupstools#3302]

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
…lso report getmyprocbasename() [networkupstools#1711]

In particular, help discern replies from the drivers launched by upsdrvctl en masse.

Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
@jimklimov
Copy link
Copy Markdown
Member Author

PR rebased over merge of #3363 to isolate changes made for this problem.

@jimklimov jimklimov merged commit ff66dbe into networkupstools:master Mar 25, 2026
22 of 26 checks passed
@jimklimov jimklimov added Windows and removed C++ SSL/NSS Issues and PRs about SSL, TLS and other crypto-related matters labels Mar 25, 2026
@jimklimov jimklimov deleted the issue-3302 branch March 25, 2026 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Entries related to continuous integration infrastructure (here CI = tools + scripts + recipes) Connection stability issues Issues about driver<->device and/or networked connections (upsd<->upsmon...) going AWOL over time enhancement Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants