Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan_at_desy.de>
---
.../src/main/java/org/glassfish/grizzly/NIOTransportBuilder.java | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/modules/grizzly/src/main/java/org/glassfish/grizzly/NIOTransportBuilder.java b/modules/grizzly/src/main/java/org/glassfish/grizzly/NIOTransportBuilder.java
index 9cc98cf..8630c8b4 100644
--- a/modules/grizzly/src/main/java/org/glassfish/grizzly/NIOTransportBuilder.java
+++ b/modules/grizzly/src/main/java/org/glassfish/grizzly/NIOTransportBuilder.java
@@ -149,6 +149,11 @@ public abstract class NIOTransportBuilder<T extends NIOTransportBuilder> {
*/
public T setSelectorThreadPoolConfig(final ThreadPoolConfig threadPoolConfig) {
transport.setKernelThreadPoolConfig(threadPoolConfig);
+ /*
+ * selector runners count MUST not be greater than number of threads in the pool
+ */
+ int selectorRunnersCount = Math.min(threadPoolConfig.getMaxPoolSize(), transport.getSelectorRunnersCount());
+ transport.setSelectorRunnersCount(selectorRunnersCount);
return getThis();
}
--
1.8.5.3