Java SDK orphan thread pool


  • @admin I am using Java SDK and noticed an issue with the SDK. I noticed that even after I am done with WebSocket listener, there are few threads and a thread pool that keep running and the java.exe process never exits.

    My quick high level analysis shows that problem could be in SmartAPITicker. Especially in getWebsocketAdapter() method where an object of class WebSocketAdapter is created. In that object, the onConnected method is creating a ServiceExecutor on which a shutdown is never called. I made the ServiceExecutor an object of that class and called service.shutdown() from WebSocketAdapter::onDisconnected() method. That seems to be the solution. Now the process exits cleanly with exit code 0.

    But I don't understand this code very well so can you please ask someone to look into this issue of process lying around and not exiting cleanly and let them review if the changes I made could fix the issue.

    Thanks.


  • @admin S476355


  • Hi @softice kindly provide us your client id.


  • @admin today I created a fat jar and ran it from console. Not exactly production like but near production like. Atleast not from IDE.

    But the process still hangs around and doesn't go away. So the issue seems to be there.

    Please confirm if this is an issue and if you are going to fix it.


  • @admin 1 additional info. I am still in early development stage and I observe this while running my code from IDE. I haven't tried running the binaries in production mode.


  • Hi @softice we have noticed your issue our team will coordinate with you on this.