diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2022-03-31 12:02:11 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2022-03-31 12:46:51 +0300 |
commit | 0375f54caa87ac87b4a29ea9af612288bcd1d311 (patch) | |
tree | af64ccd3b4a502bb2d3e257deddd118be7dfd70f /pthread_stop_world.c | |
parent | 1aebf1e327195a4ab7d39c1d6105f70204b92dbe (diff) | |
download | bdwgc-0375f54caa87ac87b4a29ea9af612288bcd1d311.tar.gz |
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.
Diffstat (limited to 'pthread_stop_world.c')
-rw-r--r-- | pthread_stop_world.c | 10 |
1 files changed, 6 insertions, 4 deletions
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); |