mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2025-02-25 07:07:52 +01:00
sched: BUG() on event_add() and log_warn next_run
It is highly unlikely to happen but if so, we need to know and why. The warning with the next_run values could help. Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
parent
77cc97cf0a
commit
c7af923567
1 changed files with 5 additions and 1 deletions
|
@ -506,7 +506,11 @@ scheduler_ev_add(const struct timeval *next_run)
|
|||
{
|
||||
tor_assert(run_sched_ev);
|
||||
tor_assert(next_run);
|
||||
event_add(run_sched_ev, next_run);
|
||||
if (BUG(event_add(run_sched_ev, next_run) < 0)) {
|
||||
log_warn(LD_SCHED, "Adding to libevent failed. Next run time was set to: "
|
||||
"%ld.%06ld", next_run->tv_sec, next_run->tv_usec);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Make the scheduler event active with the given flags. */
|
||||
|
|
Loading…
Add table
Reference in a new issue