Skip to content

Semaphore locks can't release #231

Open
@xuannv112

Description

@xuannv112

https://github.com/gocraft/work/blob/master/redis.go#L109

Take a look at how the LUA script increases the lock key. I think we should apply another mechanism for semaphore lock. It is unsafe for the current mechanism, somehow the release lock step can't be executed (https://github.com/gocraft/work/blob/master/worker.go#L267) due to connections to Redis.

In general, it should have an expired time when using the lock key.
https://redis.com/ebook/part-2-core-concepts/chapter-6-application-components-in-redis/6-3-counting-semaphores/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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