Skip to content

Commit

Permalink
[#420] Remove inaccurate assert since it is possible timer_handler() …
Browse files Browse the repository at this point in the history
…gets invoked asynchronously (due to a SIGALRM signal forwarded from the MAIN worker thread) after the STAPI_IS_SIGNAL_HANDLER_DEFERRED(sig_hndlr_timer_handler) check but before the assert(stapi_signal_handler_oscontext[sig_hndlr_timer_handler].sig_forwarded) thereby clearing the sig_forwarded flag

Note that all test failures we saw till now were related to sig_hndlr_timer_handler but it is expected
the same issue exists with other signal handler types so the fix is done for other signals too.
  • Loading branch information
nars1 committed Mar 25, 2019
1 parent bed720f commit e723c73
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
2 changes: 0 additions & 2 deletions sr_unix/sig_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ GBLREF sig_info_context_t stapi_signal_handler_oscontext[sig_hndlr_num_entries];
assert(stapi_signal_handler_deferred & (1 << SIGHNDLRTYPE)); \
stapi_signal_handler_deferred &= ~(1 << SIGHNDLRTYPE); \
SHM_WRITE_MEMORY_BARRIER; \
assert(stapi_signal_handler_oscontext[SIGHNDLRTYPE].sig_forwarded); \
stapi_signal_handler_oscontext[SIGHNDLRTYPE].sig_forwarded = FALSE; \
SHM_WRITE_MEMORY_BARRIER; \
}
Expand Down Expand Up @@ -288,7 +287,6 @@ GBLREF sig_info_context_t stapi_signal_handler_oscontext[sig_hndlr_num_entries];
* of SimpleThreadAPI mode so account for that in the assert below. \
*/ \
assert(simpleThreadAPI_active || gtm_jvm_process || (sig_hndlr_timer_handler == SIGHNDLRTYPE)); \
assert(stapi_signal_handler_oscontext[SIGHNDLRTYPE].sig_forwarded); \
SIG = stapi_signal_handler_oscontext[SIGHNDLRTYPE].sig_num; \
/* Reset "INFO" and "CONTEXT" to be usable by a later call to "extract_signal_info" */ \
INFO = &stapi_signal_handler_oscontext[SIGHNDLRTYPE].sig_info; \
Expand Down
9 changes: 0 additions & 9 deletions sr_unix/ydb_stm_invoke_deferred_signal_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@ void ydb_stm_invoke_deferred_signal_handler()
*/
if (STAPI_IS_SIGNAL_HANDLER_DEFERRED(sig_hndlr_continue_handler))
{
assert(stapi_signal_handler_oscontext[sig_hndlr_continue_handler].sig_forwarded);
assert(SIGCONT == stapi_signal_handler_oscontext[sig_hndlr_continue_handler].sig_num);
continue_handler(DUMMY_SIG_NUM, NULL, NULL);
}
if (STAPI_IS_SIGNAL_HANDLER_DEFERRED(sig_hndlr_ctrlc_handler))
{
assert(stapi_signal_handler_oscontext[sig_hndlr_ctrlc_handler].sig_forwarded);
assert(SIGCONT == stapi_signal_handler_oscontext[sig_hndlr_ctrlc_handler].sig_num);
ctrlc_handler(DUMMY_SIG_NUM, NULL, NULL);
}
Expand All @@ -50,46 +48,39 @@ void ydb_stm_invoke_deferred_signal_handler()
assert(!STAPI_IS_SIGNAL_HANDLER_DEFERRED(sig_hndlr_dbcertify_signal_handler));
if (STAPI_IS_SIGNAL_HANDLER_DEFERRED(sig_hndlr_generic_signal_handler))
{
assert(stapi_signal_handler_oscontext[sig_hndlr_generic_signal_handler].sig_forwarded);
generic_signal_handler(DUMMY_SIG_NUM, NULL, NULL);
}
if (STAPI_IS_SIGNAL_HANDLER_DEFERRED(sig_hndlr_jobexam_signal_handler))
{
assert(stapi_signal_handler_oscontext[sig_hndlr_jobexam_signal_handler].sig_forwarded);
assert((SIGBUS== stapi_signal_handler_oscontext[sig_hndlr_jobexam_signal_handler].sig_num)
|| (SIGSEGV
== stapi_signal_handler_oscontext[sig_hndlr_jobexam_signal_handler].sig_num));
jobexam_signal_handler(DUMMY_SIG_NUM, NULL, NULL);
}
if (STAPI_IS_SIGNAL_HANDLER_DEFERRED(sig_hndlr_jobinterrupt_event))
{
assert(stapi_signal_handler_oscontext[sig_hndlr_jobinterrupt_event].sig_forwarded);
assert(SIGUSR1 == stapi_signal_handler_oscontext[sig_hndlr_jobinterrupt_event].sig_num);
jobinterrupt_event(DUMMY_SIG_NUM, NULL, NULL);
}
if (STAPI_IS_SIGNAL_HANDLER_DEFERRED(sig_hndlr_job_term_handler))
{
assert(stapi_signal_handler_oscontext[sig_hndlr_job_term_handler].sig_forwarded);
assert(SIGTERM == stapi_signal_handler_oscontext[sig_hndlr_job_term_handler].sig_num);
job_term_handler(DUMMY_SIG_NUM, NULL, NULL);
}
if (STAPI_IS_SIGNAL_HANDLER_DEFERRED(sig_hndlr_op_fnzpeek_signal_handler))
{
assert(stapi_signal_handler_oscontext[sig_hndlr_op_fnzpeek_signal_handler].sig_forwarded);
assert(SIGTERM == stapi_signal_handler_oscontext[sig_hndlr_op_fnzpeek_signal_handler].sig_num);
op_fnzpeek_signal_handler(DUMMY_SIG_NUM, NULL, NULL);
}
if (STAPI_IS_SIGNAL_HANDLER_DEFERRED(sig_hndlr_suspsigs_handler))
{
assert(stapi_signal_handler_oscontext[sig_hndlr_suspsigs_handler].sig_forwarded);
assert((SIGTTIN == stapi_signal_handler_oscontext[sig_hndlr_suspsigs_handler].sig_num)
|| (SIGTTOU == stapi_signal_handler_oscontext[sig_hndlr_suspsigs_handler].sig_num)
|| (SIGTSTP == stapi_signal_handler_oscontext[sig_hndlr_suspsigs_handler].sig_num));
suspsigs_handler(DUMMY_SIG_NUM, NULL, NULL);
}
if (STAPI_IS_SIGNAL_HANDLER_DEFERRED(sig_hndlr_timer_handler))
{
assert(stapi_signal_handler_oscontext[sig_hndlr_timer_handler].sig_forwarded);
assert(SIGALRM == stapi_signal_handler_oscontext[sig_hndlr_timer_handler].sig_num);
timer_handler(DUMMY_SIG_NUM, NULL, NULL);
}
Expand Down

0 comments on commit e723c73

Please sign in to comment.