]> err.no Git - varnish/commit
After HSH_Lookup() returns NULL indicating a busy object, we diddled
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 14 Jan 2009 20:40:54 +0000 (20:40 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 14 Jan 2009 20:40:54 +0000 (20:40 +0000)
commitc9d9a8b30a2319e6ec236fc105a1f09490c49650
tree67558e15615c59da61b19f7e096968daf9ec2fda
parent91308c53aaafde9e3f19e78207727511fba900dc
After HSH_Lookup() returns NULL indicating a busy object, we diddled
the session a bit to transfer the per-request stats to the session
counters with SES_Charge().

Not only was it inconsistent to charge accounting data in the middle
of a request, it was also illegal because after the hash lock was
released we no longer owned the session.

Once a system is under sufficient load that there is a queue for the
CPU, a race could happen where upon hitting a busy object, the hash lock
was released, another thread would schedule, finish the busy object,
start the sessions on the waiting list, finish off the request we had
and then when we get the cpu again and access it, it's gone.

The previous commit (r3512) eliminated the need to call SES_Charge,
this commit removes the (option) shmlog message inside the hash lock
thus, hopefully, eliminating the race that caused #418.

Fixes: #418
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3513 d4fa192b-c00b-0410-8231-f00ffab90ce4
varnish-cache/bin/varnishd/cache_center.c
varnish-cache/bin/varnishd/cache_hash.c