Skip to content

expiration of lock_key should be relative #144

Closed
@crhg

Description

@crhg

Memcached uses monotonic clock if available, and it differs from the clock outside of it. The difference may be very large when memcached is running long time. In such cases, specifying expiration time as absolute time does not work as expected.

For example, the clock of our memcached running about 2 years are about 1 hour ahead. As a result, session lock does not work properly because expire parameter of lock (= time() + max_execution_time(30s) + 1) is past from the point of view of memcached, and therefore the lock expires immediately.

This problem can be avoided by specifying expiration parameter as number of seconds starting from current time, not absolute Unix time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions