We are providing timeout value as 0 or -1 in poll() timeout field meaning zero timeout or infinite wait . During zero timeout case poll will immediately return with return value as zero and come out of loop.But from the places where this api SOCK_wait_for_ready()is called , it is checked that return value is 0 or more
if (SOCK_wait_for_ready(sock, FALSE, FALSE) >= 0)
goto retry;
In case of zero timeout if reading fd is not ready, it will go into continuous retries and in case of access load suppose 200k registrations,10k calls running it will result CPU to shoot very high.
This is the actual problem statement,please let me know if i was able to made my point clear.
If yes,then other than putting usleep() before every retry can we provide better solution? I solved my issue using usleep
So whenever there is no fd is ready to be read it will immediately return and solve the issue of infinite query hung but due to immediate return it will go for continuous retries and causing CPU to shoot very high.This is one of the case we are suffering in our scenario after upgrading ODBC.
Why do you think it will go into continuous retries?