Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Java SDK orphan thread pool

    NodeJS SDK
    2
    6
    51
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      softice last edited by

      @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.

      A 1 Reply Last reply Reply Quote 0
      • A
        admin @softice last edited by

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

        S 1 Reply Last reply Reply Quote 0
        • S
          softice @admin last edited by

          @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.

          S 1 Reply Last reply Reply Quote 0
          • S
            softice @softice last edited by

            @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.

            A 1 Reply Last reply Reply Quote 0
            • A
              admin @softice last edited by

              Hi @softice kindly provide us your client id.

              S 1 Reply Last reply Reply Quote 0
              • S
                softice @admin last edited by

                @admin S476355

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post