grpc_iomgr_shutdown might hang in case of an error (different from ERROR_TIMEOUT) in gpr_cv_wait

10 views
Skip to first unread message

Mos Yud

unread,
Dec 24, 2019, 9:42:31 AM12/24/19
to grpc.io
Hi,

In case SleepConditionVariableCS(cv, &mu->cs, timeout_max_ms) fails at gpr_cv_wait (sync_windows.cc) because of an error that is not ERROR_TIMEOUT,
the function gpr_cv_wait  will return 0. This might lead to an hang within the loop while (g_root_object.next != &g_root_object) at grpc_iomgr_shutdown in case 
the condition g_root_object.next != &g_root_object is always satisfied and gpr_cv_wait(&g_rcv, &g_mu, short_deadline) always return 0.

Any advice how handle such an error? 
What if i check: if (gpr_time_cmp(gpr_now(GPR_CLOCK_REALTIME), shutdown_deadline) > 0) at grpc_iomgr_shutdown regardless the result of gpr_cv_wait?

Thx,
Moshe.
Reply all
Reply to author
Forward
0 new messages