Racy backend selection #2027

Closed
gquintard opened this Issue Aug 2, 2016 · 2 comments

Projects

None yet

4 participants

@gquintard
Contributor

We tripped on a WRONG():

-- panic.show --
Last panic at: Sun, 31 Jul 2016 01:43:54 GMT
"Wrong turn at vdir.c:209:

thread = (cache-worker)
version = varnish-4.1.3 revision 5e3b6d2
ident =
Linux,2.6.32-573.18.1.el6.x86_64,x86_64,-junix,-sfile,-sfile,-sfile,-smalloc,-hcritbit,epoll

It looks like that while in vdir_pick_by_weight, somebody in vdir_pick_be changes vd->vbm under us.

Expected Behavior

Not panicking would be nice

Possible Solution

Switching vdir_pick_be lock acquisition to vdir_wrlock instead of vdir_rdlock.

Your Environment

EL6, varnish 4.1.3

@slimhazard slimhazard self-assigned this Aug 2, 2016
@slimhazard
Contributor

As discussed in IRC, I will look into this.

@gquintard gquintard closed this in 9075b40 Aug 11, 2016
@hermunn
Contributor
hermunn commented Sep 6, 2016

Backport review: Fix backported as c3374b1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment