Skip to content

Commit

Permalink
Leaky trigger state when XQuery method not found
Browse files Browse the repository at this point in the history
XQuery trigger not found is acceptable behaviour (logs a debug message only, could get very chatty logs otherwise).
BUT the exit path from the exception fails to tidy up the per-thread trigger state. This has been observed to leak memory; the per-thread doesn’t get cleaned up until the thread is deleted, and the trigger cyclic-check stack just builds up.

So we clean up the trigger state when a trigger is not found.

Closes #5459
  • Loading branch information
alanpaxton authored and adamretter committed Oct 8, 2024
1 parent 1e531ce commit 3a99460
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ private void execute(final TriggerPhase phase, final TriggerEvent event, final D
if (LOG.isDebugEnabled()) {
LOG.debug("No such function '" + functionName + "' in XQueryTrigger: " + compiledQuery.getSource());
}
TriggerStatePerThread.clearIfFinished(phase);
return;
}
}
Expand Down

0 comments on commit 3a99460

Please sign in to comment.