Skip to content

PSUBSCRIBE * wildcard does not work correctly when channel name is longer than 15 characters #4948

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

Open
LucHeart opened this issue Apr 16, 2025 · 1 comment · May be fixed by #5001
Open
Assignees
Labels
bug Something isn't working
Milestone

Comments

@LucHeart
Copy link

LucHeart commented Apr 16, 2025

Describe the bug
PSUBSCRIBE * does not receive all published messages when the channel name is longer than 15 characters in length.

See additional info for a special case we discovered aswell.

To Reproduce
Steps to reproduce the behavior:

  1. Subscribe to all pub sub messages using PSUBSCRIBE *
  2. Send a message via PUBLISH in a seperate redis client with a channel name longer than 15 characters
    For example PUBLISH 1234567890123456 testvalue
  3. Inspect the subscribing redis clients output, there shouldn't be any messages

Expected behavior
It should behave like redis and receive all messages published even if the channel name is longer than 15 characters.

Screenshots
Screenshot from Redis Insight Pub/Sub tool, same behavior can be reproduced using redis-cli
Image

Environment (please complete the following information):

  • OS: [wsl, k3s on debain 12]
  • Kernel:
    • WSL: Linux Luc-Main 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
    • k3s: Linux *hostname redacted* 6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux
  • Containerized?: Docker Compose (Also happens in kubernetes with the operator)
  • Dragonfly Version: v1.28.1

Reproducible Docker Compose Setup

services:
  dragonfly:
    image: ghcr.io/dragonflydb/dragonfly:latest
    restart: unless-stopped
    ports:
      - 6379:6379

Additional context
Interesting part is if you for example subscribe to 1* and send a message on channel 1234567890123456 it seems to work again no matter the length of the channel. So it seems only * as the channel pattern is the problem.

To clarify, we dont use this in production, this is for debugging purposes only on our end.

Feel free to let me know if you need any more information on this issue, keep up the great work! Thank you

@LucHeart LucHeart added the bug Something isn't working label Apr 16, 2025
@kostasrim
Copy link
Contributor

Hi @LucHeart,

Thank you for reporting this. We will take a look

@romange romange added this to the v1.30 milestone Apr 21, 2025
mkaruza added a commit that referenced this issue Apr 25, 2025
…attern

If string is longer than 16 chars we are using Reflex library for
matching. When used pattern is '*' or '**' we are going to strip both of
stars and have empty pattern. We should in this edge case inject
manually star pattern.

Fixes #4948

Signed-off-by: mkaruza <mario@dragonflydb.io>
mkaruza added a commit that referenced this issue Apr 25, 2025
…attern

If string is longer than 16 chars we are using Reflex library for
matching. When used pattern is '*' or '**' we are going to strip both of
stars and have empty pattern. We should in this edge case inject
manually star pattern.

Fixes #4948

Signed-off-by: mkaruza <mario@dragonflydb.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants