Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #4890 trigger leak analysis #5295

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions exist-core/src/main/java/org/exist/backup/Restore.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,11 @@ public void restore(final DBBroker broker, @Nullable final Txn transaction, fina
}

// continue restore
final XMLReaderPool parserPool = broker.getBrokerPool().getParserPool();
final XMLReaderPool parserPool = broker.getBrokerPool().getXmlReaderPool();
final boolean triggersEnabled = broker.isTriggersEnabled();
XMLReader reader = null;
try {
broker.setTriggersEnabled(false);
reader = parserPool.borrowXMLReader();
listener.started(totalNrOfFiles);

Expand All @@ -99,10 +101,14 @@ public void restore(final DBBroker broker, @Nullable final Txn transaction, fina
}

} finally {
listener.finished();
try {
listener.finished();
} finally {
broker.setTriggersEnabled(triggersEnabled);

if (reader != null) {
parserPool.returnXMLReader(reader);
if (reader != null) {
parserPool.returnXMLReader(reader);
}
}
}
}
Expand Down
Loading
Loading