Open chinuhub opened 6 years ago
When instantiating BagVerifier I am now using Executors.newSingleThreadExecutor(). It fixed the issue.
For a large bag you may want to use Executors.newFixedThreadPool()
and specify how many threads you want to use instead of just using a single thread as multi-threading it will be much faster(as long as you aren't hitting IO problems).
@acdha does Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors())
seem reasonable for being the default instead of Executors.newCachedThreadPool()
?
That's exactly what I was wondering — as long as someone can override it for unusual cases, the CPU count seems like a reasonable default.
Yup, they are able to because a different user asked to be able to finely tune that threadpool. That's why there are 4 different constructors on that class, to be able to override various parts of it or keep the defaults.
Yeah, I figure there are a few cases where someone would need to change that value but it really does seem like most of them would be edge cases.
When submitting an issue please include:
Please format it in the given when then style
For example (from link above):
Given
When
Then
The exception is thrown in method "checkAllFilesListedInManifestExist(Set files)" in file PayloadVerifier.java in line
this.executor.execute(new CheckIfFileExistsTask(file, missingFiles, latch));
when a new task isto be executed on executor.
When checking the thread creation limit on mac It was 709.