]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 4528: ICAP transactions quit on async DNS lookups (#795) 4.15-20210525-snapshot 5.0.6-20210525-snapshot 6.0.0-20210525-master-snapshot
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 21 May 2021 18:47:36 +0000 (18:47 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Fri, 21 May 2021 22:41:24 +0000 (22:41 +0000)
commit26cf7c3c01c3e58178054eb99b323471e40e9703
tree090a9265556ed168c500d5e0127c68a219da162b
parent39d7714ae03e9d9b27dfb0ffdfb1a6a5de01ccf4
Bug 4528: ICAP transactions quit on async DNS lookups (#795)

The bug directly affected some ICAP OPTIONS transactions and indirectly
affected some ICAP REQMOD/RESPMOD transactions:

* OPTIONS: When a transaction needed to look up an IP address of the
  ICAP service, and that address was not cached by Squid, it ended
  prematurely because Adaptation::Icap::Xaction::doneAll() was unaware
  of ipcache_nbgethostbyname()'s async nature. This bug is fixed now.

* REQMOD/RESPMOD: Adaptation::Icap::ModXact masked the _direct_ effects
  of the bug: ModXact::startWriting() sets state.writing before calling
  openConnection() which schedules the DNS lookup. That "I am still
  writing" state makes ModXact::doneAll() false while a REQMOD or
  RESPMOD transaction waits for the DNS lookup.

  However, REQMOD and RESPMOD transactions that require an OPTIONS
  transaction (because the service options have never been fetched
  before or have expired) could still fail because the OPTIONS
  transaction they trigger could fail as described in the first bullet.
  For example, the first few REQMOD and RESPMOD transactions for a given
  service -- all those started before the DNS lookup completes and Squid
  caches its result -- could fail this way. With the OPTIONS now fixed,
  these REQMOD and RESPMOD transactions should work correctly.

Broken since inception (commit fb505fa).
src/adaptation/icap/Xaction.cc
src/adaptation/icap/Xaction.h