AZ(pthread_key_create) fails if Varnish has been running long enough #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After an uptime of 41 days, vcl.load with RE object initializations in vcl_init was causing Varnish to crash due to this assertion failure:
errno==1==EPERM=="Operation not permitted" on Linux, but I'm inclined to believe that there were just too many VCLs accumulated, too many RE objects, and we may have hit a limit for pthread keys. The VMOD may have to do a better job of cleaning up pthread keys when they are unused.
It's also possible that we hit PTHREAD_KEYS_MAX.
From the glibc docs about pthread_keys:
The docs don't mention any other reason for pthread_key_create to fail; but in that case we'd expect to see
err=EAGAIN=11in the panic message above (it might be that the panic message is not settingerrto the value oferrnocorrectly).Since Varnish 4.1, we can use PRIV_TASK scope with objects by using VRT_priv_task() from vrt.h, with the object's address as the "vmod_id" (we have this working in the blobdigest VMOD).
So that will be the solution (meaning that anyone who encounters this bug will need to upgrade to at least Varnish 4.1). Just have to implement it.
Status changed to closed by commit
26f3394ebf