Open advitum opened 5 years ago
Try an alpha version, this problem should be solved there.
Hello!
I've got the same error on alpha...
@splastunov what is your use case?
$beansConnection = new xobotyi\beansclient\Connection('127.0.0.1', 11300, 2, true);
$beansClient = new xobotyi\beansclient\BeansClient($beansConnection);
//Watch tube and get task
$job = $beansClient->watchTube('myTube')->reserve();
Failed with the same Socket error if Tube is empty.
Even if you would try to watch empty Tube with watchTube it will fail.
Allsow you have errors at documentation. listTubeUsed should be listUsedTubes and etc...
Due to it is alpha it's not documented yet.
Also seeing this issue, from what I can tell, the readline isn't waiting or is failing because its not returning anything straight away.
It happens when you do a reserve-with-timeout
OK I have worked out what the bug is
$result = fgets($this->socket, 8192); in Function ReadLine means the wait for the fgets is very short eg 1 sec.
If you are using reserve-with-timeout say set to 60, you need readline to wait for at least 60 seconds
eg with something like stream_set_timeout($this->socket, 65);
@Punkley have you checked that? If that solves the issue ill dig into it in that direction
Yep, it worksOn 28 Oct 2019 8:26 am, Anton Zinovyev notifications@github.com wrote:@Punkley have you checked that? If that solves the issue ill dig into it in that direction
—You are receiving this because you were mentioned.Reply to this email directly, view it on GitHub, or unsubscribe.
@Punkley check out the master branch. Pushed the fix, not tested yet, but it should help.
so far, so good :)
OK I think a slight tweak is needed,
Every now and then about every 10th time I get PHP Fatal error: Uncaught xobotyi\beansclient\Exception\SocketException: Unknown error in vendor/xobotyi/beansclient/src/Socket/SocketBase.php:185
I think I have however solved the issue by adding this $timeout !== null && stream_set_timeout($this->socket, $timeout +5);
eg the timeout needs to be just a little longer then the actual beanstalk timeout.
after making that change, the script has been running for 12 hours+
Kingsley
@Punkley 5 seconds is pretty much, have you tried smaller values?
@Punkley hello again. Ive attempted to improve the sockets interconnection, check out the v2.0.0-alpha.13 please.
This is a bug report.
When reserving a job using
$client->reserve();
, an unknown error gets thrown when the queue is empty.According to the documentation (and the source code), an empty queue should not throw an error, but instead result in a Job with id=null.
Versions i'm using: