Skip to content

Expiration time is not set atomically with the value #225

@ronkorving

Description

@ronkorving

When setting a value that has an expiration time, I noticed that redis-objects will first set the value, and in a separate operation set the expiration time. This is unfortunate not just for performance, but mainly because:

when setting the expiration fails (eg. due to network issues, ruby process interrupted, you name it), the value will never expire.

I have observed this problem in a production environment, where values would stick around forever. In our case, this was very problematic. Cache invalidation is a hard problem made easier by Redis (since it can be done atomically with the operation that sets the value). Unfortunately, redis-objects doesn't seem to make use of that.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions