webMethods

 View Only
Expand all | Collapse all

Killing a thread in Integration Server

  • 1.  Killing a thread in Integration Server

    Posted Mon March 18, 2013 07:34 AM

    Hi Experts,

    I have seen many posts already existing regarding this subject, but i wanted a clear picture on it.
    Scenario: I have an IS service, which had hung due to some issue(Already identified). So i need to kill that thread(Know that it shouldn’t be done often), by IS admin console. But unfortunately after cancelling, its still not getting killed.

    I saw some of the java services already being developed for this, but i dont wanna use one more thread to kill a hung thread in JVM level.
    Is restarting IS is the last resort for this?

    Any suggestions are welcome.

    Regards,
    Niteesh:)


    #webMethods-Archive
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Killing a thread in Integration Server

    Posted Mon March 18, 2013 09:23 AM

    Hi Niteesh,
    As you said, you can ‘cancel’ the hung thread, followed by ‘kill’ option enabled.

    What exactly you mean when you say, “don’t want to use one more thread to kill a hung thread in JVM level”? To kill something in JVM level, we got to issue a command in JVM level. What other option is available?

    Yes, restarting IS or killing IS thread is the last option if the thread is not getting released.

    -Senthil


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-Archive


  • 3.  RE: Killing a thread in Integration Server

    Posted Mon March 18, 2013 09:44 AM

    Thanks Senthil for the reply. What i meant was, using java native API for thread interruption we can kill a thread. But i dont think that will work work for intrinsic threads… Never mind. Better to restart the server instead of messing with jvm.

    Cheers,
    Niteesh


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-Archive


  • 4.  RE: Killing a thread in Integration Server

    Posted Mon March 18, 2013 09:57 AM

    Do you see ‘Kill’ option enabled after ‘cancel’ thread option. Can you try to ‘cancel’ thread multiple times and see if Kill is enabled or not?

    This feature was introduced in order to avoid Server restart’s due to specific hung thread. What kind of service is hung? We can still check other ways before restarting the server I think.

    -Senthil


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-Archive


  • 5.  RE: Killing a thread in Integration Server

    Posted Mon March 18, 2013 10:04 AM

    Yes, kill option(Red cross) is enabled. After clicking(repeatatively) also, its not getting killed. Service is having a repeat step which is executing infinitely.

    Thanks,
    Niteesh


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-Archive


  • 6.  RE: Killing a thread in Integration Server

    Posted Mon March 18, 2013 11:03 AM

    I just tried with a simple flow service that executes a repeat in an infinite manner. Soon after cancelling the running thread from IS admin, I see below message and execution stopped.

    Could not run ‘runInfinite’.
    com.wm.lang.flow.FlowException: [ISC.0049.9030] User Administrator issued request to terminate the flow.

    -Senthil


    #webMethods-Archive
    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: Killing a thread in Integration Server

    Posted Mon March 18, 2013 11:24 AM

    Oh… Thats great… But mine is executing ssh command inside Repeat loop. So there was a network issue and it kept on repeating. Now if i try to kill that thread, new threads are getting created which inturn trying to kill hung thread(Fascinating :slight_smile: ).

    Thanks,
    Niteesh:)


    #webMethods
    #webMethods-Archive
    #Integration-Server-and-ESB


  • 8.  RE: Killing a thread in Integration Server

    Posted Mon March 18, 2013 11:36 AM


  • 9.  RE: Killing a thread in Integration Server

    Posted Mon March 18, 2013 07:19 PM

    The rule of thumb I follow, even with the admin utility now provided by SAG: don’t kill threads; restart the server.


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-Archive


  • 10.  RE: Killing a thread in Integration Server

    Posted Mon March 18, 2013 08:28 PM

    Even when this setting having in place in 8.x.x?

    watt.server.threadKill.enabled=true

    I was too under impression that works and waiting to try that solution in my env which is one of hot feature for Admins at least:)


    #Integration-Server-and-ESB
    #webMethods-Archive
    #webMethods


  • 11.  RE: Killing a thread in Integration Server

    Posted Tue March 19, 2013 12:07 AM

    Yes, even with the new facility. Killing a thread in a JVM is generally discouraged. Too many potential side-effects. Even the SAG documentation warns about cancelling or killing threads–“Killing a thread might put your resources in an unstable state.”

    In other words, it is a roll of the dice. It may or may not successfully cancel/kill the thread. It may or may not cause additional problems. A hung thread is usually the result of not accounting for something within the code. E.g. not specifying a timeout. Or simply a bug. If one finds that they are regularly killing threads, something is wrong.


    #webMethods-Archive
    #webMethods
    #Integration-Server-and-ESB


  • 12.  RE: Killing a thread in Integration Server

    Posted Tue March 19, 2013 07:54 AM

    Yes, I agree. But most of the time it will work except few cases. I observed that, if it is not getting killed, than you should not try it more than once or twice and restarting is the best resort.

    Regards,
    Niteesh:)


    #Integration-Server-and-ESB
    #webMethods-Archive
    #webMethods


  • 13.  RE: Killing a thread in Integration Server

    Posted Tue March 19, 2013 03:16 PM

    YES as always restart is the best option for hanging threads - wish that new facility is more accurate when we know the actual stuck thread problem.


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-Archive


  • 14.  RE: Killing a thread in Integration Server

    Posted Sat March 30, 2013 03:57 AM

    I tried to kill the thread using admin console twice before, but It didn’t get killed. so I went for a restart…But I sucessfully killed the thread few months back…So, we are not sure when this will work out and when it will not…Still I feels, bettter option is going for a restart.


    #Integration-Server-and-ESB
    #webMethods-Archive
    #webMethods


  • 15.  RE: Killing a thread in Integration Server

    Posted Sat March 30, 2013 10:04 AM

    Hi Jana,

    I would advise, first check the reason for hanging(Make sure that it wont happen after you restart). Also try to kill one or two times max from admin panel. If still does not work,then go for restart and don’t try to kill it repetitively(It wont work and increase unnecessary threads).

    My $.02
    Niteesh


    #webMethods-Archive
    #Integration-Server-and-ESB
    #webMethods


  • 16.  RE: Killing a thread in Integration Server

    Posted Sun March 31, 2013 03:56 AM


  • 17.  RE: Killing a thread in Integration Server

    Posted Sun March 31, 2013 06:27 PM

    Also make sure you take 3 Java core thread dumps during IS hung kill -3 PID (with minute a part for 3 times) and open a ticket with SAG and provide them (server,stats,error log) and you can also do some analysis from the server/error logs for more troubleshooting analysis.

    HTH
    RMG


    #webMethods
    #webMethods-Archive
    #Integration-Server-and-ESB