[master] b02c78438 PRIV_TASK vtc: tolerate fini order

Dridi Boukelmoune dridi at varni.sh
Tue Jan 12 17:23:04 UTC 2021


On Tue, Jan 12, 2021 at 5:09 PM Nils Goroll <nils.goroll at uplex.de> wrote:
>
>
> commit b02c78438c4e36d967a866466c9ce0cccb32dc0f
> Author: Nils Goroll <nils.goroll at uplex.de>
> Date:   Tue Jan 12 18:07:09 2021 +0100
>
>     PRIV_TASK vtc: tolerate fini order
>
>     this turned out to be harder than I thought: I had not considered the
>     fact that fini order of a red-black tree indexed by uintptrs depends on
>     the memory order.
>
>     Ref d89c8bf59b9da8263f1a767c68e4ee35d2569d11

Feature idea, logexpect undefined order:

    expect ? =    Debug             ^priv_task_free
    expect ? =    Debug             ^obj_priv_task_fini

The "?" token would mean that consecutive expect statements using it
could appear in a non-deterministic order.

Thoughts?

> diff --git a/bin/varnishtest/tests/r02451.vtc b/bin/varnishtest/tests/r02451.vtc
> index 39cf67aa2..b25163a65 100644
> --- a/bin/varnishtest/tests/r02451.vtc
> +++ b/bin/varnishtest/tests/r02451.vtc
> @@ -53,9 +53,10 @@ logexpect l1 -v v1 -g raw -d 1 {
>         expect 0 *    VCL_Log           {^func something to remember}
>         expect 0 *    Debug             {^objx.priv_task.*"something to remember".$}
>         expect 0 *    VCL_Log           {^obj something to remember}
> -       expect 0 *    Debug             {^priv_task_free}
> -       # string stored in obj priv_task has already been freed
> -       expect 0 *    Debug             {^obj_priv_task_fini}
> +       # string stored in obj priv_task can already been freed,
> +       # depending on the order
> +       expect 0 *    Debug             {^priv_task_free|^obj_priv_task_fini}
> +       expect 0 *    Debug             {^priv_task_free|^obj_priv_task_fini}
>         expect 0 *    Debug             {^vcl1: VCL_EVENT_WARM}
>  } -start
>
> diff --git a/bin/varnishtest/tests/v00041.vtc b/bin/varnishtest/tests/v00041.vtc
> index 55415bd1d..f3febd423 100644
> --- a/bin/varnishtest/tests/v00041.vtc
> +++ b/bin/varnishtest/tests/v00041.vtc
> @@ -120,9 +120,9 @@ logexpect l0 -v v1 -g raw -d 1 -q "vxid == 0 and not ExpKill" {
>         expect 0 =    VCL_Log           {^objc initX}
>         expect 0 =    Debug             {^objb.priv_task.. = .*"initY"}
>         expect 0 =    VCL_Log           {^objb initY}
> -       expect 0 =    Debug             {^priv_task_free}
> -       expect 0 =    Debug             {^obj_priv_task_fini.*"initX"}
> -       expect 0 =    Debug             {^obj_priv_task_fini.*"initY"}
> +       expect 0 =    Debug             {^priv_task_free|^obj_priv_task_fini}
> +       expect 0 =    Debug             {^priv_task_free|^obj_priv_task_fini}
> +       expect 0 =    Debug             {^priv_task_free|^obj_priv_task_fini}
>         expect 0 =    Debug             {^vcl1: VCL_EVENT_WARM}
>
>         # 1001/1002
> @@ -135,8 +135,8 @@ logexpect l0 -v v1 -g raw -d 1 -q "vxid == 0 and not ExpKill" {
>         expect 0 =    Debug             {^priv_task_free}
>         expect 0 =    Debug             {^obj_priv_task_fini.*"r1002"}
>         expect 0 =    Debug             {^test_priv_task.*exists}
> -       expect 0 =    Debug             {^priv_task_free}
> -       expect 0 =    Debug             {^obj_priv_task_fini.*"d1001"}
> +       expect 0 =    Debug             {^priv_task_free|^obj_priv_task_fini.*"d1001"}
> +       expect 0 =    Debug             {^priv_task_free|^obj_priv_task_fini.*"d1001"}
>
>         # ...
>         # 1006 pipe
> _______________________________________________
> varnish-commit mailing list
> varnish-commit at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit


More information about the varnish-commit mailing list