Skip to content

Listening to Redis 'del' now might trigger OnRemove twice #168

@MichaConrad

Description

@MichaConrad

The OnRemove event now gets triggered twice when calling cache.Remove, if

  • using Redis cache handle
  • keyspace notifications are enabled
  • redis server is configured to send keyspace notifications for del (common operations)

Solution:
I might have to change the OneRemoveByHandle listener in BaseCacheManager to not trigger OnRemove if the event comes from redis del. That was introduced to handle "manual" del calls via redis-cli or similar, but it is not really working out like that...

I might change the event type to Removed from ExternalRemove and make it consistent across all caches. This would be a bigger breaking change and bigger change in general as I'd have to listen on ANY remove in all in-memory caches, too => deferring that to later milestone maybe.
Instead, changing it to cleanup cache handles Up (as evict would do) and not trigger OnRemove is the more straight forward fix...

This will be a breaking change to 1.1.0 (might not really affect anymore though).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions