Skip to content
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

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

Open
tenstep opened this issue Oct 1, 2015 · 1 comment

Comments

@tenstep
Copy link

tenstep commented Oct 1, 2015

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?

@Keris
Copy link

Keris commented May 9, 2017

Try with unlimited timeout, this solves my problem.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants