-
Notifications
You must be signed in to change notification settings - Fork 381
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
vcc: Internal type for the reserved 'default' symbol #4190
Conversation
A new DEFAULT type identifies symbols called 'default' and types that can have a default symbol carry a pseudo symbol. This approach can reconcile the overloaded default symbols that all share the generic type DEFAULT but carry their respective kinds. This helps remove some of the special casing for default probes and backends whilst offering a sentinel DEFAULT type to safely deal with the special casing where it is actually needed, simplifying the code a wee bit in those areas. Fixes varnishcache#4177
I appreciate the fix, but as a vcc-noob I would be like to learn why a |
When I started using Varnish it was perfectly legal to have multiple symbols of the same type, see for example 9962996 that introduced coverage for a corner case. The test case contains 3 distinct It was a deliberate choice to only allow one symbol for a given name in bd30219 and as you can see from the explanation in the commit message that is the turning point where symbols became unique. The The introduction of a DEFAULT type here makes it completely wrong or completely correct. As a side note on symbol uniqueness modulus
Yes but not really. Because |
I think I'm OK with this handling of it. |
Not sure if this is a good idea, but under all circumstances something like set bereq.backend = default;
set bereq.http.healthy = bereq.backend.healthy() should continue to work. |
This is fine because |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this can be merged, phk agreed already
As long as there were questions or remarks I would still consider the review to be in progress. Between here and #4177 you raised interesting points. |
I shouldn't have picked the magic values from vmodtool.py in the first place. Refs #4190
late correction:
I think you meant "multiple symbols of the name name (and different types)" and also read this, even though this is not was was written. |
A new DEFAULT type identifies symbols called 'default' and types that can have a default symbol carry a pseudo symbol. This approach can reconcile the overloaded default symbols that all share the generic type DEFAULT but carry their respective kinds.
This helps remove some of the special casing for default probes and backends whilst offering a sentinel DEFAULT type to safely deal with the special casing where it is actually needed, simplifying the code a wee bit in those areas.
Fixes #4177