Reputation: 467
My PHP script reads from my DB and sends messages to the queue so that worker roles (well other LAMP machines) can pull them and work in parallel.
However, often times my script ends with a Fatal Error with the following message in my error_log on my apache server. This error is on the sending side.
PHP Notice: fwrite(): send of 414 bytes failed with errno=32
Broken pipe in /home/azureuser/pear/share/pear/HTTP/Request2/SocketWrapper.php on line 202
PHP Fatal error: Uncaught HTTP_Request2_MessageException:
Error writing request in /home/azureuser/pear/share/pear/HTTP/Request2/Adapter/Socket.php
on line 130
Exception trace
HTTP_Request2_SocketWrapper->write('POST /proxy/mess…')
/home/azureuser/pear/share/pear/HTTP/Request2/Adapter/Socket.php:130
HTTP_Request2_Adapter_Socket->sendRequest(Object(HTTP_Request2))
/home/azureuser/pear/share/pear/HTTP/Request2.php:93
in /home/azureuser/pear/share/pear/HTTP/Request2/SocketWrapper.php on line 206
It seems to me the socket throws an exception for some reason that is not handled and thus crashes the script. If you agree, do you suggest it is a good idea to fix the SDK?
Upvotes: 1
Views: 289
Reputation: 34
Have you tried to increase the endpoint timeout value to which your php socket is connecting to. The default timeout is 4 mins for a VM endpoint. You can change this to a higher value. Here is the article on how to do that. https://azure.microsoft.com/blog/2014/08/14/new-configurable-idle-timeout-for-azure-load-balancer/
Check this section: "Set Idle Timeout when creating an Azure endpoint on a Virtual Machine" in above link.
Upvotes: 0
Reputation: 4088
Looked into this really quickly for a first pass, but it seems:
fwrite(): send of 414 bytes failed with errno=32
Refers to a dropped socket, which could happen for a few reasons:
Have you been able to look at the FREB logs or run the PHP Process Report in the Support Portal (https://[site-name].scm.azurewebsites.net/Support) to diagnose the why the socket is being dropped?
Upvotes: 1