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
Compare 'bereq.backend' / 'req.backend_hint' myDirector.backend() does not work #2168
Comments
This works in -trunk, maybe as a result of the sym/var type changes I made to VCC some days ago (9d81a71) |
Assigning to @hermunn (you can ping me if you need help on this one) |
In
A proper work-around is
In
The type system in vcl has changed a lot i master since 4.1, and I would say that comparing backend expressions is a feature not present in 4.1, and that we should leave it that way. However, trying to make a shorter, similar workaround for
turns out to crash VCC with the message:
I will try to fix the crash, but in my opinion nothing else should be done for 4.1. |
The crash in the previous comment happens because The expression In The next time One solution would be, in |
I wrote a patch, hermunn@2db2901 , that should fix the problem with the crash, and maybe be helpful. Comments are welcome. |
@hermunn what would error messages look like? |
The test case checks the error messages to some degree, but I should give you the full info: In the first
In the second
The point here is that people might privoed an expression. Maybe I should use the word "expected" in this message? In the last
which is unchanged from before the patch. |
No it's fine, it's just that since it's not a pull request I won't |
I think I will just change the error message slightly and push this. If anyone feels the need to fix this further, that's ok, but right now we should be happy to get rid of the crash and know what the work-around is. |
Comparing a backend with various stuff was not handled well. The test case shows what will give a compilation error, and the results of ways of comparing backends. When using a director, the demonstrated results are not obvious. Fixes: #2168
Since this issue is not in master and 18c9983 fixes this in 4.1, I am closing this issue. |
Backport review: This patch was to 4.1, and the problem does not exist in 5.0. |
"if ( req.backend_hint == d1.backend() )" and also "if ( bereq.backend == d1.backend() )" does not compile in Varnish 4.1.4. Please see the following Varnish Test Case:
Please also see the following discussion:
https://www.varnish-cache.org/lists/pipermail/varnish-misc/2016-December/025500.html
https://www.varnish-cache.org/lists/pipermail/varnish-misc/2016-December/025502.html
https://www.varnish-cache.org/lists/pipermail/varnish-misc/2016-December/025504.html
https://www.varnish-cache.org/lists/pipermail/varnish-misc/2016-December/025505.html
@Dridi says: "mention that it does work on the master branch"
Current Behavior
Your Environment
The text was updated successfully, but these errors were encountered: