BlackLab
BlackLab copied to clipboard
HitsFromQueryParallel: if an exception (e.g. NPE) occurs in one of the SpansReaders, it disappears.
It would be better if the exception is re-thrown in the main search thread so we are alerted to the problem. Instead, the hits that this SpansReader would have retrieved just seem to go missing.
FileProcessor seems to have the same issue: tasks executed by an executor whose exceptions are silently ignored. We should look at other uses of ExecutorService as well.
See https://stackoverflow.com/questions/2248131/handling-exceptions-from-java-executorservice-tasks on how to handle exceptions in ExecutorService tasks.
(from @KCMertens) This commit seems to have introduced the problem, by not using f.get() but checking f.isDone()/f.isCancelled() in a stream operation: https://github.com/inl/blacklab/commit/63f1401363718b33e1788aaf58f5ba6df57f4f00
Just marking this fixed: https://github.com/INL/BlackLab/commit/c17048b31abbc309530a13787a832c10c4bf8991