-
Notifications
You must be signed in to change notification settings - Fork 382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setting backend timeouts to zero does not wait forever #3045
Comments
Lmk how you want to fix this, im working on some timeout stuff at the moment and can submit a PR. The problem is that a value of zero is special and forces Varnish to read the value from 1 level up in the config. So even if this is fixed, this is unusable from VCL. It might be best to not allow a value of zero at all and force the user to set it very high if they want to actually wait forever. |
Forever is a long time, should that really be the behaviour ? |
Bugwash consensus: 1msec is what we want for 0 timeouts. DocFix wanted. |
This ticket was brought to my attention by @walid-git after he unsuccessfully tried to set a zero timeout on a backend definition, to realize that this zero value would simply not act as an override of the related parameter. I don't remember which of The point is that zero was used for both "no timeout as in non-blocking poll" and "timeout not set". With #4041 we discussed a similar problem with the perception of unset In #4043 I fixed what I considered a bug of a zero I merged #4043 after a couple bugwash iterations, during which we discussed several aspects of the change, but never questioned the meaning of a zero value disabling the timeout. It went even further as #4043 formalizes in the documentation that zero disables all timeouts (except parameters with a non-zero minimum value). Nobody remembered the consensus from this thread. I sincerely don't remember my personal opinion back then. I know that today I'd rather allow disabling timeouts with a zero value, or, have a timeout tweak that accepts a special value I will be the first to warn about disabling timeouts, but one of our principles states:
So I don't see a reason to prevent timeouts from being disabled, in particular task deadlines and future timeouts that don't exist today. Of course, depending on the outcome, I'm planning to address all the problems highlighted above. |
(edit: set Based on the discussion during last bugwash, here's a proposal to clarify the questions from the last comment: For timeouts, we will always establish a hierarchy, as for example today with So by this example, unset only applies to vcl and backend, parameters can not be unset. They need to provide some value to ultimately use, even if it is a default (which we already cater for with Besides "unset", we have two other values to clarify: the "zero" timeout and the "never" timeout. In this ticket, we agreed that "zero" would mean "a very small value", and it seems we do not want to change that. On the other end, it seems we want to have a proper definition of "never". To summarize: Timeouts receive three special values:
Strawman A):
The respective backend and vcl timeouts would be, by default, Strawman B) VCL:
The actual |
Do we agree that we can't set |
The side effect of using |
My proposal was that you could. Sure, this would, for all practical circumstances, be identical to |
I found one gotcha with the use of INF instead of 0 to disable a timeout: we can't represent infinity in JSON, for I think my preference goes to "never". |
|
But at the same time "never" would be a valid argument for |
From now on, INFINITY disables the timeout and NAN is no longer allowed. Refs varnishcache#3045
For all intents and purposes, it currently is exactly the same as the timeout tweak. The duration parameters are either not really timeouts, or timeouts that cannot be disabled. In other words, the timeout tweak will grow the ability to formally disable a timeout. Refs varnishcache#3045
From now on, INFINITY disables the timeout and NAN is no longer allowed. Refs varnishcache#3045
For all intents and purposes, it currently is exactly the same as the timeout tweak. The duration parameters are either not really timeouts, or timeouts that cannot be disabled. In other words, the timeout tweak will grow the ability to formally disable a timeout. Refs varnishcache#3045
From now on, INFINITY disables the timeout and NAN is no longer allowed. Refs varnishcache#3045
For all intents and purposes, it currently is exactly the same as the timeout tweak. The duration parameters are either not really timeouts, or timeouts that cannot be disabled. In other words, the timeout tweak will grow the ability to formally disable a timeout. Refs varnishcache#3045
From now on, INFINITY disables the timeout and NAN is no longer allowed. Refs #3045
For all intents and purposes, it currently is exactly the same as the timeout tweak. The duration parameters are either not really timeouts, or timeouts that cannot be disabled. In other words, the timeout tweak will grow the ability to formally disable a timeout. Refs #3045
According to the docs, setting certain timeouts like
first_byte_timeout
andbetween_byte_timeout
to0
causes them to disable and wait forever, but this is not the case.varnish-cache/include/tbl/params.h
Lines 248 to 249 in f4dcf8f
These timeouts zero out, but then get unzeroed here:
varnish-cache/bin/varnishd/cache/cache_session.c
Lines 333 to 334 in f4dcf8f
VTC:
The text was updated successfully, but these errors were encountered: