nicolasff/phpredis — Issue #99: Exception thrown in blPop()
Author: arctica
Created: 2011-12-09 18:03:37+00:00
State: open

I'm getting an exception "read error on connection" when trying to do a blocking LPOP on a list (list doesn't exist actually).

The code is pretty simple

```php
$res = $redis->blPop('daemon_http_import:todo', 30);
```

It takes about 3-4 seconds and the exception is thrown. Other commands seem to work fine.
Here some strace output:

```strace
sendto(5, "*3\r\n$5\r\nBLPOP\r\n$23\r\ndaemon_http_"..., 54, MSG_DONTWAIT, NULL, 0) = 54
poll([{fd=5, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 0) = 0 (Timeout)
poll([{fd=5, events=POLLIN|POLLERR|POLLHUP}], 1, 3500) = 0 (Timeout)
close(5) = 0
write(2, "Exception: /scripts/daemon_http_"..., 67Exception: /scripts/daemon_http_import:37 read error
on connection
) = 67
```

No idea why it throws the exception and then even closes the connection to redist.
I tried other timeout values but it's always the same. As seen on the strace output, it doesn't even wait long enough for the timeout to expire.