Commit 9c7bded 1 parent 802f520 commit 9c7bded Copy full SHA for 9c7bded
File tree 1 file changed +11
-3
lines changed
1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -203,8 +203,17 @@ ctx::fiber_context Scheduler::Preempt() {
203
203
if (FiberActive () == dispatch_cntx_.get ()) {
204
204
LOG (DFATAL) << " Should not preempt dispatcher: " << GetStacktrace ();
205
205
}
206
- if (IsFiberAtomicSection ())
207
- LOG (DFATAL) << " Preempting inside of atomic section" ;
206
+
207
+ if (IsFiberAtomicSection ()) {
208
+ static int64_t last_ts = 0 ;
209
+ int64_t now = time (nullptr );
210
+ if (now != last_ts) { // once a second at most.
211
+ last_ts = now;
212
+ LOG (DFATAL) << " Preempting inside of atomic section, fiber: " << FiberActive ()->name ()
213
+ << " , stacktrace:\n " << GetStacktrace ();
214
+ }
215
+ }
216
+
208
217
DCHECK (!ready_queue_.empty ()); // dispatcher fiber is always in the ready queue.
209
218
210
219
FiberInterface* fi = &ready_queue_.front ();
@@ -457,7 +466,6 @@ void Scheduler::PrintAllFiberStackTraces() {
457
466
add_time = false ;
458
467
}
459
468
460
-
461
469
string print_cb_str;
462
470
#ifndef NDEBUG
463
471
print_cb_str = fb->stacktrace_print_cb_ ? fb->stacktrace_print_cb_ () : string{};
You can’t perform that action at this time.
0 commit comments