vmod-saintmode: Allow using blacklist in vcl_backend_error#216
Conversation
|
Hi,
That looks reasonable, can we get some testing around it please?
…On Thu, Jul 20, 2023, 04:06 delthas ***@***.***> wrote:
In a way, this reverts 1
<varnish/libvmod-saintmode@d8658c9>
.
Previously, we would prevent users from blacklisting a backend from
vcl_backend_error. But this is actually useful to users: when a backend
fails to respond (and is considered healthy due to e.g. a varnishadm call),
we may want to blacklist it for a short while, in order to return (retry)
and be sure that we do not use this backend for our second try.
This changes the behavior to checking if there is an available backend,
e.g. if we are in vcl_backend_response or vcl_backend_error.
------------------------------
You can view, comment on, or merge this pull request online at:
#216
Commit Summary
- ca99b67
<ca99b67>
vmod-saintmode: Allow using blacklist in vcl_backend_error
File Changes
(2 files <https://github.com/varnish/varnish-modules/pull/216/files>)
- *M* src/vmod_saintmode.c
<https://github.com/varnish/varnish-modules/pull/216/files#diff-fc2f58f9a03642817745d4ae6050eeda27dee8092f2da624ad27092130c1472a>
(4)
- *M* src/vmod_saintmode.vcc
<https://github.com/varnish/varnish-modules/pull/216/files#diff-a02dc29fe58c430ce1aa6935fb91a7ea32c5470c2ea9386abf13f96c8628c2c5>
(5)
Patch Links:
- https://github.com/varnish/varnish-modules/pull/216.patch
- https://github.com/varnish/varnish-modules/pull/216.diff
—
Reply to this email directly, view it on GitHub
<#216>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA42AKJDWFV3OAP773XNJJ3XREGMRANCNFSM6AAAAAA2RIBAAM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
|
@delthas ? |
|
one last bump |
|
@gquintard Ack, have seen the comment, I'll work on it later |
|
@delthas , bump :-) |
In a way, this reverts [1]. Previously, we would prevent users from blacklisting a backend from vcl_backend_error. But this is actually useful to users: when a backend fails to respond (and is considered healthy due to e.g. a varnishadm call), we may want to blacklist it for a short while, in order to `return (retry)` and be sure that we do not use this backend for our second try. This changes the behavior to checking if there is an available backend, e.g. if we are in vcl_backend_response or vcl_backend_error. [1]: varnish/libvmod-saintmode@d8658c9
ca99b67 to
5d39951
Compare
|
Hi, Actually I'm not using this anymore. I had to mix dynamic backends with blacklists so I ended up making a patch on libvmod-dynamic to add a blacklist support and I'm not using saintmode anymore. But the patch still makes sense for other users I think. Regarding the test, I just pushed a trivial test that just calls blacklist from vcl_backend_error (and so that implicitly checks that we are not asserting). I suppose we could do something more clever to actually check that the backend was indeed blacklisted by making the backend error then be available again. |
|
|
||
| CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC); | ||
| if (ctx->method != VCL_MET_BACKEND_RESPONSE) { | ||
| if (!ctx->bo || !ctx->bo->director_resp) { |
There was a problem hiding this comment.
actually, we can get rid of this, and just use $Restrict in the VCC.
@delthas, do you want to do it, or should I?
|
bump |
In a way, this reverts 1.
Previously, we would prevent users from blacklisting a backend from vcl_backend_error. But this is actually useful to users: when a backend fails to respond (and is considered healthy due to e.g. a varnishadm call), we may want to blacklist it for a short while, in order to
return (retry)and be sure that we do not use this backend for our second try.This changes the behavior to checking if there is an available backend, e.g. if we are in vcl_backend_response or vcl_backend_error.