Added Hyperf\Crontab\Mutex\RedisServerMutexByNodeName.#7555
Merged
limingxinleo merged 9 commits intohyperf:masterfrom Feb 1, 2026
Merged
Added Hyperf\Crontab\Mutex\RedisServerMutexByNodeName.#7555limingxinleo merged 9 commits intohyperf:masterfrom
Hyperf\Crontab\Mutex\RedisServerMutexByNodeName.#7555limingxinleo merged 9 commits intohyperf:masterfrom
Conversation
Contributor
onekb
commented
Oct 8, 2025
- 修复多节点 Docker 环境下容器默认 MAC 前缀一致(例:02:42:ac:..)导致多容器 Redis 锁误判为同一节点的问题:原本的 swoole_get_local_mac() 返回的地址相同,使得节点互相抢锁却都认为自己持有锁(src/Mutex/RedisServerMutex.php:24, 86-139)
- 改为在启动时生成随机节点标识并缓存于容器或进程,确保每个实例拥有独立身份;若外部注入了 ServerNodeInterface,仍优先使用其名称以支持自定义实现
Member
|
是不是新增一个独立的类更好 |
Contributor
Author
Member
|
不是,通过di更换 |
limingxinleo
previously approved these changes
Feb 1, 2026
Hyperf\Crontab\Mutex\RedisServerMutexByNodeName.
limingxinleo
approved these changes
Feb 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

