[master] 11d55148a Put some serious red tape on VCL_STRANDS

Dridi Boukelmoune dridi at varni.sh
Thu Nov 21 11:37:36 UTC 2019


On Thu, Nov 21, 2019 at 11:05 AM Nils Goroll <nils.goroll at uplex.de> wrote:
>
> On 19/11/2019 19:07, Dridi Boukelmoune wrote:
> >>     This also begs the following question: can it ever be safe to let a VMOD
> >>     function return a STRANDS? Maybe it should be banned from return types.
> >
> > I think the rules I laid out makes this fine in the scope of a single
> > VCL statement.
>
> My understanding is that we should apply the same rule as for any other data
> types in VCL: Ensure that they have at least TASK lifetime.
>
> Then, the rules for keeping references to STRANDS become the same as for BLOBs:
> If you want to keep a reference for longer than a TASK, you need to make a copy.
>
> For that copy, I would think that the STRANDS should be collapsed and we might
> want to add some convenience utilities.

I have no strong opinion on this, I'll happily amend the comment if
the expectations change but I believe the red tape is currently in
sync with reality. However, I'm a bit wary of making this kind of
implicit memory retention possible for strings, unlike blobs that will
require active vmod involvement.


Dridi


More information about the varnish-commit mailing list