Skip to content

Commit 003128b

Browse files
alanpaxtonadamretter
authored andcommitted
[bugfix] Leaky trigger state when XQuery method not found
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
1 parent 024276e commit 003128b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

exist-core/src/main/java/org/exist/collections/triggers/XQueryTrigger.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ private void execute(final TriggerPhase phase, final TriggerEvent event, final D
451451
if (LOG.isDebugEnabled()) {
452452
LOG.debug("No such function '" + functionName + "' in XQueryTrigger: " + compiledQuery.getSource());
453453
}
454+
TriggerStatePerThread.clearIfFinished(phase);
454455
return;
455456
}
456457
}

0 commit comments

Comments
 (0)