Varnish image purge does not take into account purger list

Created on 1 October 2021, over 3 years ago
Updated 8 July 2024, 9 months ago

Problem/Motivation

The varnish image purge module does not take into account the active purgers. Instead it only purges the URL on it's own instance.
A list of purgers is being declared within varnish_image_purge_entity_update, but is then never used again.

Steps to reproduce

Add multiple varnish instances and then try to purge a media item, for example.

Proposed resolution

Actually ensure that the URIBAN is being issued on all purger instances.

πŸ› Bug report
Status

Needs review

Version

2.1

Component

Code

Created by

πŸ‡³πŸ‡±Netherlands basvanderheijden

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡³πŸ‡±Netherlands ralphvdhoudt

    Updated patch for version 2.2

  • πŸ‡«πŸ‡·France regilero

    There's one problem with this patch. Duplication of requests when you have multiple purgers defined targeting the same backend.

    The patch code is parsing all purgers and adding the varnish hosts of each purger to duplicate the requests, which seems OK at first. It's better than the current code trying to reach the main domain (especially on complex installations where you have better chances to reach varnish by an internal name instead of using the main domain for purge requests).
    But if you have multiple purgers defined in varnish_purge, like when you use 'wildcard paths' purgers, and 'tags' purger, and some others.
    These various purgers may reference the exact same varnish server. Then you would duplicate several the URIBAN requests, targeting the exact same Varnish backend. So we need to add a deduplication on the scheme+host+port list of varnish servers.

    There's a second problem if you use the patches from https://www.drupal.org/project/varnish_purge/issues/2843978 ✨ Multiple IP's for one varnish purger Needs review to allow multiple varnish servers to be referenced in each purger. But I'll make another comment soon for another version of the patch in that case (that should be using the `getUris()` function added in these patch).

  • πŸ‡«πŸ‡·France regilero

    This version is better because as I said in previous comment you might be using patches from https://www.drupal.org/project/varnish_purge/issues/2843978 ✨ Multiple IP's for one varnish purger Needs review to get the very much expected feature of defining several front varnish servers for one purger (via array or space separated string).
    If you do not use these patches this current patch will still work as expected.

  • πŸ‡«πŸ‡·France regilero

    After version 2.3 the previous patch is failing. This new version should work.

  • πŸ‡«πŸ‡·France simon georges Rouen, France

    It feels like an important fix to allow for a real generic use of purging with Varnish.

  • πŸ‡«πŸ‡·France regilero

    Previous match had a missing line, this one should work

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan
  • πŸ‡ΊπŸ‡ΈUnited States nicxvan

    nicxvan β†’ changed the visibility of the branch 3240266-varnish-image-purge to hidden.

Production build 0.71.5 2024