Repository navigation
nut-scanner: balance worker admission and cleanup - #3649
user01010111 wants to merge 9 commits into
Conversation
Skip inactive protocol semaphores, unwind partial admission, and return owned permits when worker allocation or creation fails. Allocate tracking entries before starting workers and keep NUT hostname and authentication cleanup with the worker until it finishes. Add offline regression tests using real threads and semaphores, preserve the counter and non-threaded paths, and record the change in NEWS. Related to networkupstools#1166. Global semaphore initialisation policy remains separate. Prepared with assistance from OpenAI Codex (gpt-6-astra). Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
|
A ZIP file with standard source tarball and another tarball with pre-built docs for commit 481d706 is temporarily available: NUT-tarballs-PR-3649.zip. |
Pass the configured SSL include flags to the scanner tests for NSS builds. Order scanner recursion after common and client dependencies, and generate the SNMP header before compiling the test source. Prepared with assistance from OpenAI Codex (gpt-6-astra). Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
| nutscan_free_ip_ranges(&ranges); | ||
| } | ||
|
|
||
| static void scenario(unsigned int limit, int failure) |
| } | ||
| # endif | ||
|
|
||
| static void scan(unsigned int limit) |
| void *arg; | ||
| }; | ||
|
|
||
| static void *offline_worker(void *opaque) |
Track the protocol semaphore only after successful initialisation, and check destruction or close before clearing fixture state. Assert clean state at scenario entry and clear the global semaphore after teardown. Assisted by OpenAI Codex (gpt-6-astra). Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
|
CI errors could be due to crashed server, builds will be restarted soon. However content-wise, is there a particular reason to not provide the code in |
Move the shared worker helpers into nutscan-thread.c and keep declarations in the header. Preserve internal symbol visibility and the existing failure-injection tests. Assisted by OpenAI Codex (gpt-6-astra). Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
Good catch, Jim. Thank you. Have updated now. |
|
Some makefile nuances missed,
|
…riate [networkupstools#3649] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Link the scanner test with configured Net-SNMP libraries when static SNMP support is enabled. Keep the libraries after its object file so MinGW resolves the SNMP symbols. Verified the failing baseline and 68 passing cases on native x86_64 Windows, 204 Linux scanner cases, and distcheck-light. The i686 build remains untested. Assisted by OpenAI Codex. Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
Retain ordinary Net-SNMP executable flags alongside the existing library passthrough flags and link every scanner fixture with them. Keep discovery and cache handling in the existing dependency macro. Give the included scanner mutex its own fixture name and preserve assertions with NDEBUG. Order the two common-library sub-makes so their shared replacement-function objects cannot race during parallel builds. Validated static scanner tests on Linux and native MinGW Windows with NDEBUG, clean two-job builds, and distcheck-light with install/uninstall. Prepared with OpenAI Codex (GPT-6) assistance, following the earlier Claude Opus 5.5 review. Signed-off-by: user01010111 <12504630+user01010111@users.noreply.github.com>
|
The scanner tests pass against static libnutscan on Linux and MinGW Windows, including builds with The Windows all-static check also showed why the Net-SNMP dependency needs to cover every scanner fixture: loading the initialiser can pull in the SNMP scanner even for the NUT test. Configure now retains the ordinary executable linker flags alongside the existing libtool passthrough flags, and the common test rule places them after libnutscan. The production library workaround is unchanged. The test prerequisites also order the two common-library sub-makes, which otherwise race while rebuilding the same replacement-function objects. Clean parallel builds with two jobs now pass. The distribution and install/uninstall checks pass too. Prepared with Codex assistance, following the earlier Claude Opus 5.5 review. |
|
✅ Build nut 2.8.5.5899-master completed (commit 51b8cadefa by @jimklimov)
|
Disabled protocol limits still reached a protocol semaphore, and partial admission or worker-start failures could lose permits. Allocate thread tracking before starting a worker, balance acquired permits on failure, and retain NUT hostname and authentication data until its worker finishes. The existing batch scheduling and address-skipping behaviour after failed thread creation are retained.
Add offline regression tests for the actual SNMP, IPMI, NUT and XML/HTTP admission loops using real threads and semaphores, and document the change in NEWS. The test build rules include SSL header paths and order shared libraries and generated headers for clean parallel builds.
Validation:
make checkwith NSS,make check-parallel-builds, and a cleantests/build withmake -s -j.make spellcheck,make -j2 distcheck-light, and release-note HTML generation. Spelling used Aspell 0.60.8.2 with the unmodified GNU English 2020.12.07 dictionary; the 2026.02.25 dictionary rejects unchanged baseline possessives. The distribution check excludes full manual rendering and an all-drivers build.The patch builds independently on the upstream base. No live device or hardware scan was performed.
Related to #1166. The global semaphore initialisation failure policy remains separate, as discussed in the existing clarification.
Prepared with assistance from OpenAI Codex (
gpt-6-astra). The human contributor remains responsible for reviewing and validating the change.