metafacture / metafacture-core

Core package of the Metafacture tool suite for metadata processing.
https://metafacture.org
Apache License 2.0
71 stars 34 forks source link

Exception occurs when more threads are used than documents exists #466

Open dr0i opened 2 years ago

dr0i commented 2 years ago

Reported at https://github.com/hbz/lobid-resources/issues/1030#issue-502574421:

When more threads are used than documents exists a NullPointerException occurs.

When calling closeStream(), a NullPointerException appears. This stops the ETL process finishing correctly and results in loss of processed documents. A workaround is to catch the Exception. However, as this is a problem can occur everywhere, it would be nicer to somehow control this probably at the ObjectPipeDecoupler. Also, to say the least, it's rather unexpected to use more threads than documents, it may happen.