Hi cosimo, Very simple, we crash and bring the whole thing down: https://github.com/varnish/varnish-modules/blob/master/src/vmod_vsthrottle.c#L99
IIRC, on Linux, malloc always returns with an allocation, or OOM-kills you -- Guillaume Quintard On Wed, Apr 11, 2018 at 12:47 PM, Cosimo Streppone <[email protected]> wrote: > Hi, > > I'm looking at the vsthrottle vmod. Have a proof of concept VCL up and > running, > and it seems to work very nicely (with varnish 4.1.9). Thanks for this > work! > > I'm wondering what vsthrottle's behaviour is when there's no memory > available, > specifically when tb_alloc() fails. > > From what I can understand from the code[1]: > > b = tb_alloc(digest, limit, period, now); > AZ(VRB_INSERT(tbtree, &v->buckets, b)); > > and tb_alloc() also checks for a non-zero malloc result (AN()). > > I understand we're talking about a remote possibility, and I see vsthrottle > reclaims unused memory. However, when no memory is available for the > malloc, > will varnish leave a trace in syslog, exit and restart by way of the > asserts? > > -- > Cosimo > > [1] https://github.com/varnish/varnish-modules/blob/master/ > src/vmod_vsthrottle.c#L126-L127 > _______________________________________________ > varnish-misc mailing list > [email protected] > https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc >
_______________________________________________ varnish-misc mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
