Closed as not planned
Description
Describe the bug
We've merged the latest version after validating the fix was deployed - #135 yet the thread count has started to increase significantly. The threads aren't getting closed after the completion of the task unlike DataLoaderRegistry.
We've initialized ScheduledDataLoaderRegistry in the following way in the ServiceContextImpl -
public ScheduledDataLoaderRegistry getScheduledDataLoaderRegistry() {
if (null == scheduledDataLoaderRegistry) {
DispatchPredicate dispatchPredicate = DispatchPredicate.dispatchIfLongerThan(Duration.ofMillis(50));
scheduledDataLoaderRegistry = ScheduledDataLoaderRegistry.newScheduledRegistry()
.registerAll(dataLoaderRegistry)
.dispatchPredicate(dispatchPredicate)
.build();
}
return scheduledDataLoaderRegistry;
}
The issue is that the threads are not getting closed after the execution of the scheduledDataLoaderRegistry and when the response is ready and sent back.
In this case, shouldn't the logic be handled in a way when there is nothing to be dispatched and all data loaders have completed their work, we should close the thread?