From 0375f54caa87ac87b4a29ea9af612288bcd1d311 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 31 Mar 2022 12:02:11 +0300 Subject: Increase limit greatly before aborting on signals delivery failure (fix of commit ece1b1378) Also, print GC number in abort message when signals delivery failed. * pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL] (RESEND_SIGNALS_LIMIT): Change value from 25 to 150. * pthread_stop_world.c [!GC_OPENBSD_UTHREADS && !NACL] (resend_lost_signals): Set retry local variable to 0 if newly_sent is not equal to prev_sent; print GC number in abort message. --- pthread_stop_world.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'pthread_stop_world.c') diff --git a/pthread_stop_world.c b/pthread_stop_world.c index f92c4927..808673ed 100644 --- a/pthread_stop_world.c +++ b/pthread_stop_world.c @@ -484,7 +484,7 @@ static int resend_lost_signals(int n_live_threads, int (*suspend_restart_all)(void)) { # define RETRY_INTERVAL 100000 /* us */ -# define RESEND_SIGNALS_LIMIT 25 +# define RESEND_SIGNALS_LIMIT 150 if (n_live_threads > 0) { unsigned long wait_usecs = 0; /* Total wait since retry. */ @@ -500,9 +500,11 @@ static int resend_lost_signals(int n_live_threads, if (wait_usecs > RETRY_INTERVAL) { int newly_sent = suspend_restart_all(); - if (newly_sent == prev_sent /* no progress */ - && ++retry >= RESEND_SIGNALS_LIMIT) - ABORT("Signals delivery fails constantly"); + if (newly_sent != prev_sent) { + retry = 0; /* restart the counter */ + } else if (++retry >= RESEND_SIGNALS_LIMIT) /* no progress */ + ABORT_ARG1("Signals delivery fails constantly", + " at GC #%lu", (unsigned long)GC_gc_no); GC_COND_LOG_PRINTF("Resent %d signals after timeout, retry: %d\n", newly_sent, retry); -- cgit v1.2.1