hyperf / hyperf/socketio-server
【BUG】 socketio:clear 命令异常, 当 redis 配置了 prefix 选项后,一定会出现清除失败!
- Vorherrschende Sprache
- PHP
- Sterne
- 26
- Forks
- 6
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
redis配置了前缀,并且 scan 配置了Redis::SCAN_PREFIX (其实配置不配置,都会出现问题,只要redis的options配置了前缀)
情况1:
当 scan 选项没有配置时,则scan默认为不加前缀,则调用 scan 命令获取不到keys,所以就没有清除的效果
情况2:
当 scan 选项配置为Redis::SCAN_PREFIX 时,则调用scan 命令能获取到keys, 但这些key是原始的key (添加了前缀), 则调用 del 命令会失败 (因为del也会自动添加前缀,就导致添加了两次前缀).
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Start by tracing the socketio:clear command and how its Redis scan and delete operations handle configured prefixes. Reproduce the issue with a Redis prefix, testing both the default scan behavior and Redis::SCAN_PREFIX. Done means the command finds and deletes the intended keys without applying the prefix twice.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- php, redis
- Bereich
- backend, databases
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 52/100