]> git.ipfire.org Git - thirdparty/squid.git/commit
Temporary fix: Avoid killing Coordinator with unregistered cache mgr actions
authorAlex Rousskov <rousskov@measurement-factory.com>
Wed, 21 Sep 2011 18:05:55 +0000 (12:05 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Wed, 21 Sep 2011 18:05:55 +0000 (12:05 -0600)
commit46a7dc66ead0e64123576d9760680fdc82b91875
tree0810ea636a7ee2e57dab8adc27efe8e7a780ab3b
parent2be46d6709526a1c4454c0f5fa8716efe354b617
Temporary fix: Avoid killing Coordinator with unregistered cache mgr actions
that cause isOpen() assertions.

If a worker forwards a cache manager request to Coordinator and Coordinator
does not have that action registered, CacheManager::createRequestedAction()
throws (as it should) and Mgr::Request cleanup asserts when its half-baked
connection tries to close a not-yet-imported socket descriptor.

This workaround catches the exception, reports it, and manually closes the
socket descriptor. It also prevents an ACK response from being sent to the
worker, which triggers a worker timeout.

Mid-term TODO: Coordinator should register all actions that are known to kids.
Should Coordinator respond with an error instead of relying on a timeout?

Long-term TODO: Consider an API where cache manager responses can be
aggregated and formatted by Coordinator without knowing action-specific
details. After all, there are not so many types of action information (size,
count, rate, etc.) and most actions have simple reporting formats. Currently,
it is awkward to guarantee that Coordinator and all workers know all actions,
especially when some actions may be specific to non-worker kids such as
Coordinator and diskers.
src/ipc/Coordinator.cc