Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Recoursive implementation of push send method causes StackOverflowError in tomcat #439
I'm using this setup in my tomcat 8.5 app:
'org.jboss.weld.servlet', name: 'weld-servlet', version: '2.4.0.Final'
I'm using socket component and here is what I've observed in logs of my application:
I've shortened the stacktrace above (it has a lot of send calls, and looks like even cutted by jvm as at the bottom is still SocketSessionManager.send).
I'm not shure what am I doing wrong but this recoursive implementation without any recoursion depth limit or sleeps betwen retries looks dangerous to me:
Also, looks like in my case original public send method also sometimes blocks for a long time (when send finally works), and I can't protect from this, as public send returns set of Future objects, so in theory it should not block the caller thread, however, the recoursive retries still happen in caller thread...