Have written a java process in spring-boot, process uses fork-join pool.
Process run fine sometimes and completed successfully, sometimes it hangs indefinitely start using very high cpu still making no progress on task.
Thread dump show runnable state for only 3 types of work which are as follows:
1. java.lang.Thread.State: RUNNABLE
at java.util.WeakHashMap.put(WeakHashMap.java:453)
at java.util.Collections$SetFromMap.add(Collections.java:5461)
at org.apache.cxf.jaxrs.client.spec.ClientImpl$WebTargetImpl.initTargetClientIfNeeded(ClientImpl.java:358)
at org.apache.cxf.jaxrs.client.spec.ClientImpl$WebTargetImpl.request(ClientImpl.java:260)
at org.apache.cxf.jaxrs.client.spec.ClientImpl$WebTargetImpl.request(ClientImpl.java:366)
2. "C2 CompilerThread2" #30 daemon prio=9 os_prio=0 tid=0x00007ff9b0979000 nid=0x250be waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
3."GC task thread#12 (ParallelGC)" os_prio=0 tid=0x00007ff9b0034800 nid=0x24f94 runnable
Further trying to debug issue, I have few inputs ::
I am using org.apache.cxf.jaxrs.client, When analysed found initTargetClientIfNeeded method of ClientImpl is using 2 property thread.safe.client and thread.safe.client.state.cleanup.period. Do i need to define these 2 properties to make it thread safe ?