In a cron process, I use cURL to get information from an API. Sometimes the cron process freezes/hangs because of an issue with the API connection.
When I do an strace -p pID, the process is just polling an fd resource and then timesout repeatedly.
When I do an lsof -p pID, I see that the fd resource mentioned in the strace has an entry like this:
php 26942 root 8u IPv4 1853797972 0t0 TCP ip-XX-X-XX-XXX.ec2.internal:XXXXX->13.68.25.XXX:https (ESTABLISHED)
Nothing else is after this entry.
It appears that something is happening with the TCP connection to the API. Which timeout option for cURL can I use to avoid having my cron process hang at this point in the cURL transaction?