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

Semaphore locks can't release #231

Open
xuannv112 opened this issue Mar 31, 2023 · 0 comments
Open

Semaphore locks can't release #231

xuannv112 opened this issue Mar 31, 2023 · 0 comments

Comments

@xuannv112
Copy link

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant