Skip to content

Fix for #877 - async VarnishPurgeListener changes - #878

Merged
djtfmartin merged 1 commit into
devfrom
fix/877-varnish-purge-lock-fix
Nov 18, 2026
Merged

djtfmartin merged 1 commit into
devfrom
fix/877-varnish-purge-lock-fix

Conversation

@djtfmartin

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Shutdown does not wait for queued or running purges to finish, risking unpurged committed changes when daemon workers exit or dependent services are destroyed.

1 open issue
What changed in this PR

This PR reduces request blocking by moving Varnish invalidation to background workers and bounding optional dataset-count lookups.

Changes:

  • Queues purge work on a bounded executor, deferring transactional events until commit.
  • Adds a configurable timeout for approximate-count lookups, returning empty results on failure.
  • Wires executor shutdown into Spring and adds test dependencies.
File Description
registry-search/​src/​main/​java/​org/​gbif/​registry/​search/​dataset/​service/​DatasetApproximateCountsService.java Uses the asynchronous Elasticsearch client with a bounded wait.
registry-events/​src/​main/​java/​org/​gbif/​registry/​events/​VarnishPurgeListener.java Adds background purge dispatch, commit-aware scheduling, and a shutdown hook.
registry-events/​src/​main/​java/​org/​gbif/​registry/​events/​config/​VarnishPurgeConfiguration.java Passes the worker count and registers the destroy callback.
registry-events/​pom.xml Adds JUnit Jupiter and Mockito test dependencies.

Review effort: Balanced

@djtfmartin
djtfmartin marked this pull request as ready for review November 18, 2026 13:56
@djtfmartin
djtfmartin merged commit 01af3d1 into dev Nov 18, 2026
4 checks passed
@djtfmartin
djtfmartin deleted the fix/877-varnish-purge-lock-fix branch November 18, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants