Digits
Digits

Reputation: 2684

PHP-FPM waiting forever

So I've got a php-fpm + nginx + mongodb stack running well, unfortunately when I cancel a page loading it locks me out forever. I've got timeouts set on my script but here's a problem, when I cancel a script's execution via cmd-. it does not cancel immediately and instead goes into an infinite sleep loop.

This means I've got a server sleeping for a second over and over for many hours despite having a short execution time. All that it's doing in my strace right now is this:

epoll_wait(9, {}, 1, 1000)              = 0
epoll_wait(9, {}, 1, 1000)              = 0
epoll_wait(9, {}, 1, 1000)              = 0
epoll_wait(9, {}, 1, 1000)              = 0
epoll_wait(9, {}, 1, 1000)              = 0

earlier it was doing this instead before I restarted:

nanosleep({0, 10000000}, NULL)          = 0
nanosleep({0, 10000000}, NULL)          = 0
nanosleep({0, 10000000}, NULL)          = 0
nanosleep({0, 10000000}, NULL)          = 0
nanosleep({0, 10000000}, NULL)          = 0

I tried fixing the issue multiple times with no result. Any ideas?

Also sleep functions don't count towards script execution timeout so it'll go on forever until restart I guess.

Upvotes: 2

Views: 1166

Answers (1)

Digits
Digits

Reputation: 2684

I forgot about this question but fixed my issue. It was the ParallelCurl library breaking. It was using nanosleep to check if a download was completed, nanosleep prevented the script from reaching the timeout limit. Replacing the instances of nanosleep with sleep fixed this issue.

Upvotes: 1

Related Questions