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 78efaac
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ 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)) {
boolean d = log.isDebugEnabled();
log.error("This callback MUST NOT be called multiple times!! Make sure caller only calls it ONCE!{}",
d ? "" : " (enable debug log to see stack)", d ? new Exception("here a stack for you") : (Exception) null);
return;
}
onOneDone(req, ex);
}
}, req.ctx);
Expand Down

0 comments on commit 78efaac

Please sign in to comment.