[dev] Infinite loop

Kieran Brahney kieran at supportpal.com
Wed Jul 27 15:34:19 UTC 2022


Hello,

I'm wondering whether anyone has experienced infinite loops on email 
download? We received several reports of stuck processes (running for 
several days). The cases are usually difficult to debug due to running 
on production systems without debug mode active, and the problems 
sporadic nature... The issue is compounded by the fact that we use a 
lock file to prevent multiple connections to the mail server.

Here's what we've identified as a recurring theme: imaps connection, 
IPv4, PHP 7.3 / 7.4 (unable to test on PHP 8+), EAGAIN always on the 
imaps file descriptor. The strace appears to always be identical on 
stuck processes (ignoring the different fd).

I'm wondering whether it's something to do with 
https://github.com/horde/Imap_Client/blob/master/lib/Horde/Imap/Client/Socket/Connection/Socket.php#L135 
as that appears to be the only infinite loop. Any thoughts appreciated!

|# lsof /home/supportvhost/public_html/storage/app/scheduled-task-1.lck 
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME php 30652 
supportvhost 6uW REG 253,1 0 50331739 
/home/supportvhost/public_html/storage/app/scheduled-task-1.lck # lsof 
-p 30652 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME [...] php 
30652 supportvhost 0r FIFO 0,9 0t0 63933860 pipe php 30652 supportvhost 
1w CHR 1,3 0t0 1028 /dev/null php 30652 supportvhost 2w CHR 1,3 0t0 1028 
/dev/null php 30652 supportvhost 3w CHR 1,3 0t0 1028 /dev/null php 30652 
supportvhost 4w CHR 1,3 0t0 1028 /dev/null php 30652 supportvhost 5u 
unix 0xffff935e7095ec00 0t0 63932311 socket php 30652 supportvhost 6uW 
REG 253,1 0 50331739 
/home/supportvhost/public_html/storage/app/scheduled-task-1.lck php 
30652 supportvhost 7u IPv4 63935665 0t0 TCP 
[domain-name]:53528->[domain-name]:imaps (ESTABLISHED) # strace -v -p 
30652 -e trace=all -e write=all -e read=all -f -tt strace: Process 30652 
attached 20:50:35.644498 poll([{fd=7, events=POLLIN|POLLPRI}], 1, 29999) 
= 0 (Timeout) 20:51:05.659318 fcntl(7, F_GETFL) = 0x802 (flags 
O_RDWR|O_NONBLOCK) 20:51:05.659611 fcntl(7, F_SETFL, O_RDWR) = 0 
20:51:05.660242 poll([{fd=7, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, 
0) = 0 (Timeout) 20:51:05.660601 fcntl(7, F_GETFL) = 0x2 (flags O_RDWR) 
20:51:05.660772 fcntl(7, F_SETFL, O_RDWR|O_NONBLOCK) = 0 20:51:05.660956 
read(7, 0x18b1913, 5) = -1 EAGAIN (Resource temporarily unavailable)|

-- 
Best Regards,

Kieran Brahney
SupportPal Limited

Join us on Facebookhttps://www.facebook.com/supportpal.limited
Follow us on Twitterhttp://twitter.com/SupportPal

This e-mail is intended solely for the addressee and is strictly confidential. If you are not the intended addressee, please do not read, print, retransmit, store or act in reliance on it or any attachments. Instead please notify me immediately and delete the message from your computer.
  
E-mail transmission cannot be guaranteed to be secure or error free and I accept no liability for changes made to this e-mail (and any attachments) after it was sent or for viruses arising as a result of this e-mail transmission.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xB35E37406F48682B.asc
Type: application/pgp-keys
Size: 3130 bytes
Desc: OpenPGP public key
URL: <https://lists.horde.org/archives/dev/attachments/20220727/0014a0ec/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.horde.org/archives/dev/attachments/20220727/0014a0ec/attachment.sig>


More information about the dev mailing list