]> git.ipfire.org Git - thirdparty/squid.git/commit
Drop helpless helper requests (#1471)
authorEduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Sat, 18 Nov 2023 19:06:24 +0000 (19:06 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 18 Nov 2023 19:06:28 +0000 (19:06 +0000)
commit569605b9dce14d2543722dfad145fa40248b268c
tree7067c3b7eca3646b2e682b23e61da8f77ba39d9e
parent2c6781d8b54a93b89e4395e65feba77f985beb94
Drop helpless helper requests (#1471)

When a helper has no server programs left (e.g., because all started
programs, if any, have quit and no new programs could be started), drop
all queued helper requests, so that their corresponding master
transactions do not get stuck.

Existing handleFewerServers() already handles this situation by killing
Squid, but we must drop queued requests in other places (that can be
found by locating code that adjusts childs.n_active) because:

* that existing Squid-killing code effectively excludes several use
  cases (e.g., it ignores common startup=0 helper configurations);

* handleFewerServers() may not be called in some relevant cases
  (e.g., when no new servers were needed after a reconfiguration);

* handleFewerServers() may be followed by a helperOpenServers() call
  (that may open new servers for handling queued requests); we do
  not want to kill queued requests in those cases.

Squid may recover and successfully start another helper later, but
transaction X progress must not rely on an unrelated transaction Y
actions: If transaction Y does not show up or does not result in a
successful helper program start, then transaction X will continue to be
queued at the helper level, possibly forever (even request timeouts are
handled by individual helper server objects that we lack here).

Also significantly simplified HelperServerClosed() implementations.
src/helper.cc
src/helper.h