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

PgsqlMutex does not support timeout. #16

Closed
ypavlov opened this issue Mar 24, 2017 · 3 comments
Closed

PgsqlMutex does not support timeout. #16

ypavlov opened this issue Mar 24, 2017 · 3 comments

Comments

@ypavlov
Copy link

ypavlov commented Mar 24, 2017

Hi,
I'm trying to use yii2-queue with postgres db. And I've got an error:
Exception 'yii\base\InvalidParamException' with message 'PgsqlMutex does not support timeout.'

Stack trace:
#0 /project/vendor/yiisoft/yii2/mutex/Mutex.php(72): yii\mutex\PgsqlMutex->acquireLock('zhuravljov\yii\...', 3)
#1 /project/vendor/zhuravljov/yii2-queue/src/db/Driver.php(128): yii\mutex\Mutex->acquire('zhuravljov\yii\...', 3)
#2 /project/vendor/zhuravljov/yii2-queue/src/db/Driver.php(102): zhuravljov\yii\queue\db\Driver->pop()
#3 /project/vendor/zhuravljov/yii2-queue/src/db/Command.php(30): zhuravljov\yii\queue\db\Driver->run()

@zhuravljov
Copy link
Member

zhuravljov commented Mar 24, 2017

I don't use postgresql and don't know how PgsqlMutex works. You can try to use FileMutex instead.

@zhuravljov
Copy link
Member

Also, you can try to set db\Driver::$mutexTimeout to 0 using PgsqlMutex.

@ypavlov
Copy link
Author

ypavlov commented Mar 27, 2017

Thanks for quick fix.
There is one more issue. Postgres returns resource instead of sting for binary fields.

So I've modified unserialize method in PhpSerializer:

$buffer = fread($serialized, 1024*1024);
return unserialize($buffer);

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

No branches or pull requests

2 participants