Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MichaCo opened this issue Jun 15, 2017 · 1 comment
Closed

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

MichaCo opened this issue Jun 15, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@MichaCo
Copy link
Owner

MichaCo commented Jun 15, 2017

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).

@MichaCo MichaCo added the bug label Jun 15, 2017
@MichaCo MichaCo added this to the 1.1.1 milestone Jun 15, 2017
@MichaCo MichaCo self-assigned this Jun 15, 2017
@MichaCo
Copy link
Owner Author

MichaCo commented Jul 2, 2017

Fixed in 1.1.1

@MichaCo MichaCo closed this as completed Jul 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant