<div dir="ltr">Hi cosimo,<div><br></div><div>Very simple, we crash and bring the whole thing down: <a href="https://github.com/varnish/varnish-modules/blob/master/src/vmod_vsthrottle.c#L99">https://github.com/varnish/varnish-modules/blob/master/src/vmod_vsthrottle.c#L99</a></div><div><br></div><div>IIRC, on Linux, malloc always returns with an allocation, or OOM-kills you</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- <br></div>Guillaume Quintard<br></div></div></div>
<br><div class="gmail_quote">On Wed, Apr 11, 2018 at 12:47 PM, Cosimo Streppone <span dir="ltr"><<a href="mailto:cosimo@streppone.it" target="_blank">cosimo@streppone.it</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm looking at the vsthrottle vmod. Have a proof of concept VCL up and running,<br>
and it seems to work very nicely (with varnish 4.1.9). Thanks for this work!<br>
<br>
I'm wondering what vsthrottle's behaviour is when there's no memory available,<br>
specifically when tb_alloc() fails.<br>
<br>
>From what I can understand from the code[1]:<br>
<br>
    b = tb_alloc(digest, limit, period, now);<br>
    AZ(VRB_INSERT(tbtree, &v->buckets, b));<br>
<br>
and tb_alloc() also checks for a non-zero malloc result (AN()).<br>
<br>
I understand we're talking about a remote possibility, and I see vsthrottle<br>
reclaims unused memory. However, when no memory is available for the malloc,<br>
will varnish leave a trace in syslog, exit and restart by way of the asserts?<br>
<span class="HOEnZb"><font color="#888888"><br>
-- <br>
Cosimo<br>
<br>
[1] <a href="https://github.com/varnish/varnish-modules/blob/master/src/vmod_vsthrottle.c#L126-L127" rel="noreferrer" target="_blank">https://github.com/varnish/<wbr>varnish-modules/blob/master/<wbr>src/vmod_vsthrottle.c#L126-<wbr>L127</a><br>
______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
<a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br>
</font></span></blockquote></div><br></div>