Getting Thread Stuck and ArrayIndexOutOfBoundsException Issues in Spring Reactor (reactor.core.Reactor)

119 views Asked by At

We had a long running process(written in JAVA) which was taking so much time to complete entire execution. hence, we had decided to improve the performance by converting process from single thread to multi-thread.

So we decided to use Spring Reactor and have converted entire process into multi-threading by implementing Spring Reactor (1.1.3.RELEASE).

After implementation, have improved the performance and achieved goal which we was looking for initially.

But after 1 week testing, we observed two major problems.

1) Thread Stuck Issue : We have created total 3 Reactors with pool size 5 that means 3 reactors are parallel being executed with thread size 5 per each.

2) java.lang.ArrayIndexOutOfBoundsException

java.lang.ArrayIndexOutOfBoundsException: 0 at com.gs.collections.impl.set.mutable.UnifiedSet.copyToArray(UnifiedSet.java:1992) at com.gs.collections.impl.set.mutable.UnifiedSet.toArray(UnifiedSet.java:1972) at com.gs.collections.impl.utility.Iterate.toArray(Iterate.java:2558) at com.gs.collections.impl.list.mutable.FastList.newList(FastList.java:188) at com.gs.collections.impl.set.mutable.UnifiedSet.toList(UnifiedSet.java:1330) at com.gs.collections.impl.collection.mutable.AbstractUnmodifiableMutableCollection.toList(AbstractUnmodifiableMutableCollection.java:590) at reactor.event.registry.CachingRegistry.select(CachingRegistry.java:131) at reactor.event.dispatch.AbstractLifecycleDispatcher.route(AbstractLifecycleDispatcher.java:67) at reactor.event.dispatch.AbstractMultiThreadDispatcher$MultiThreadTask.run(AbstractMultiThreadDispatcher.java:89) at reactor.event.dispatch.WorkQueueDispatcher$3.onEvent(WorkQueueDispatcher.java:89) at reactor.event.dispatch.WorkQueueDispatcher$3.onEvent(WorkQueueDispatcher.java:86) at com.lmax.disruptor.WorkProcessor.run(WorkProcessor.java:138) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

This issues are not coming up often but we are facing this 1 or 2 times in a week. I am not able to find the direction to solve this problems even we have decent server configuration.

Can anyone please help me to solve this problems. Please share your thought.

0

There are 0 answers