A libcurl in my php code seems to be stuck indefinitely in a poll call. When I did an strace to the process id,
[user@server ~]$ sudo strace -p 19559
Process 19559 attached - interrupt to quit
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 0) = 0 (Timeout)
poll([{fd=7, events=POLLIN}], 1, 1000) = 0 (Timeout)
This goes on indefinitely. The fd 7 is shown in /proc/19559/fd as
lrwx------ 1 root root 64 Sep 19 19:44 7 -> socket:[335178801]
Can someone tell me why this is happening. What can I do to make libcurl exit when it timesout
curl_setoptoptionCURLOPT_CONNECTTIMEOUTif set to nonzero value will render curl to fail on timeout.