Skip to content

Fatal error: Uncaught exception 'RedisException' with message 'read error on connection' #12

Description

@tenstep

when i test the redlock file, the program terminates with following fatal error:

Fatal error: Uncaught exception 'RedisException' with message 'read error on connection' in C:\OpenSource\xampp\htdocs\demo\vendor\ronnylt\redlock-php\src\RedLock.php on line 99
RedisException: read error on connection in C:\OpenSource\xampp\htdocs\demo\vendor\ronnylt\redlock-php\src\RedLock.php on line 99

The test code is as follow:

    $servers = [
        ['127.0.0.1', 6379, 0.01]
    ];

    $redLock = new RedLock($servers);
    $i = 0;
    while ($i<100) {
        echo $i."\r\n";
        $lock = $redLock->lock('newOrder', 1000);

        if ($lock) {
            var_dump($lock);
        } else {
            echo "Lock not acquired\r\n";
        }
        $i++;
    }

Sometimes it runs without error, however, it terminates with error most of the time, what's the problem?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions