Skip to content

Commit

Permalink
[bugfix] 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 eXist-db#5459
  • Loading branch information
alanpaxton authored and adamretter committed Oct 8, 2024
1 parent 024276e commit 003128b
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,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 003128b

Please sign in to comment.