使用随机节点标识替换基于 MAC 的 Redis 锁节点区分#13
Closed
onekb wants to merge 1 commit intohyperf:masterfrom
onekb:master
Closed
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,仍优先使用其名称以支持自定义实现
|
Hi, this is a READ-ONLY repository, please submit your PR on the https://github.com/hyperf/hyperf repository. |
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.