Skip to content

Commit

Permalink
SDCISA-18302: Add logging in case unreachable code gets reached.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenalpha committed Dec 10, 2024
1 parent 447c105 commit 333bea5
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,11 @@ private <Ctx> void resume(Request<Ctx> req) {
// this boolean is just for paranoia, in case mentor tries to call back too often.
final AtomicBoolean isCalled = new AtomicBoolean();
@Override public void accept(Throwable ex, Void ret) {
if (!isCalled.compareAndSet(false, true)) return;
if (!isCalled.compareAndSet(false, true)) {
if (log.isDebugEnabled()) log.warn("This callback MUST NOT be called multiple times!! Make sure caller only calls it ONCE!", new Exception("stacktrace"));
else log.warn("This callback MUST NOT be called multiple times!! Make sure caller only calls it ONCE! (enable debug log to see stack)");
return;
}
onOneDone(req, ex);
}
}, req.ctx);
Expand Down

0 comments on commit 333bea5

Please # to comment.