-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Create a lock abstract layer and remove old one #22176
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
Conversation
Need to run |
The error is returned argument hasn't been handled. |
Resolved. |
Build error is related. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Co-authored-by: Yarden Shoham <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a brief review, I think there are some bugs and some designs are wrong.
- Old
StartIfNotRunning
won't block if it can not acquire the lock, it's incorrect to replace it directly byLock
- In
TransferOwnership
, the same lock is locked twice without unlocking the previous lock - The Redis lock behavior is totally different from the internal lock. Redis lock will return error in 8 seconds if the lock can not be acquired, it might break the old logic -- which expects the lock can be acquired in the end without error.
## Sync (`sync`) | ||
|
||
- `LOCK_SERVICE_TYPE`: **memory**: Lock service type, could be `memory` or `redis` | ||
- `LOCK_SERVICE_CONN_STR`: **\<empty\>**: Ignored when `LOCK_SERVICE_TYPE` is `memory` type, for `redis`, it likes `addrs=127.0.0.1:6379 db=0` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this use the same connection string format which the other redis types are using?
Please follow #26486 |
This PR introduce an abstract lock layer. For a single instance, just use
memory
lock which is default value. For a multiple instances deployment, change to a distributed lock based onredis
.Try to fix ##19620