10000 Phpredis 6.0 psubscribe() with wildcards will instantly stop after receive first message · Issue #2395 · phpredis/phpredis · GitHub
[go: up one dir, main page]

Skip to content
Phpredis 6.0 psubscribe() with wildcards will instantly stop after receive first message #2395
@asika32764

Description

@asika32764

Test Code

$redis = new Redis();
$redis->connect('127.0.0.1');

$r = $redis->psubscribe(
    ['foo.*'],
    function () {
        var_dump('Received');
    }
);

var_dump('Subscribe STOP', $r);

And run this command:

redis-cli PUBLISH "foo.1" "Hello"

Expected behaviour

Receive message and show Received

Actual behaviour

Stop subscribe and show:

string(14) "Subscribe STOP"
bool(false)

Other Test cases

  • Use subscribe() can work.
  • Use psubscribe() without wildcards also works.
  • Only psubscribe() with wildcard pattern will break.

Screen Recording

6.0.1 not work

2023-09-25 20 20 06

But 5.3.7 works

2023-09-25 20 21 02

I'm seeing this behaviour on

  • OS: MacOS / Ubuntu
  • Redis: 6.0.8
  • PHP: 8.2
  • phpredis: 6.0.1

Steps to reproduce, backtrace or example script

I've checked

  • There is no similar issue from other users
  • Issue isn't fixed in develop branch

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0