BlackLab icon indicating copy to clipboard operation
BlackLab copied to clipboard

HitsFromQueryParallel: if an exception (e.g. NPE) occurs in one of the SpansReaders, it disappears.

Open jan-niestadt opened this issue 2 years ago • 1 comments

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.

jan-niestadt avatar Jul 26 '22 08:07 jan-niestadt

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.

jan-niestadt avatar Aug 03 '22 11:08 jan-niestadt

(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

jan-niestadt avatar Sep 23 '22 08:09 jan-niestadt

Just marking this fixed: https://github.com/INL/BlackLab/commit/c17048b31abbc309530a13787a832c10c4bf8991

KCMertens avatar Oct 04 '22 08:10 KCMertens