Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,15 @@ public List<EcodDomain> getDomainsForPdb(String id) throws IOException {
// unlock to allow ensureDomainsFileInstalled to get the write lock
logger.trace("UNLOCK readlock");
domainsFileLock.readLock().unlock();
indexDomains();
domainsFileLock.readLock().lock();
logger.trace("LOCK readlock");
try {
indexDomains();
} finally {
// re-acquire even if indexing failed, so the outer finally has a
// lock to release; otherwise IllegalMonitorStateException replaces
// the real cause and the failure becomes unreadable
domainsFileLock.readLock().lock();
logger.trace("LOCK readlock");
}
}

PdbId pdbId = null;
Expand Down Expand Up @@ -244,9 +250,15 @@ public List<EcodDomain> getAllDomains() throws IOException {
// unlock to allow ensureDomainsFileInstalled to get the write lock
logger.trace("UNLOCK readlock");
domainsFileLock.readLock().unlock();
ensureDomainsFileInstalled();
domainsFileLock.readLock().lock();
logger.trace("LOCK readlock");
try {
ensureDomainsFileInstalled();
} finally {
// re-acquire even if the download failed, so the outer finally has a
// lock to release; otherwise IllegalMonitorStateException replaces
// the real cause and the failure becomes unreadable
domainsFileLock.readLock().lock();
logger.trace("LOCK readlock");
}
}
return allDomains;
} finally {
Expand Down
Loading