No response within timeout — Assuming process is hung!

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf No response within timeout — Assuming process is hung!

  • Creator
    Topic
  • #48123
    Rick Martin
    Participant

      I have a TCL script running from a batch script (Windows platform) via hcitcl.  One of the things it has to do is check the status of a thread and possibly stop/start it.  This works some of the time, but intermittently, I receive the following error:

      No response within timeout — Assuming process is hung!

      when executing the following, $cmd is either pstop or pstart:

      catch {exec cmd.exe /c hcicmd -p $pname -c “$tname $cmd”} result

      Is there a way around this? Can the timeout be increased?

      Thanks, Rick

    Viewing 2 reply threads
    • Author
      Replies
      • #57720
        Charlie Bursell
        Participant

          That message simply means the command thread was too busy to acknowledge your request within its allotted time.  That timeout is fixed.  That does not mean the action did not happen.  It means you didn’t get an acknowledgement that it happened.

          It is for this reason that I prefer to place threads that I will be stopping and starting from a script within its own process.  When you call hcienginestop, if the engine does not stop within a certain time, the hcienginestop script will kick it to death.

          Also, you may wish to change that time.  By default, it can take up to 300 seconds (5 minutes) for an engine to shut down if it is hung.

          All you need to do is edit the hcienginestop script in the $HCIROOT/bin directory.  Look for the following subroutine:

          sub waitForIt {

             local( $name ) = @_;

             local( $tries ) = 30;

             while( ($pid = &getHciEnginePid( $name )) && $tries– ) {

                 sleep 10;

             }

             return $pid;

          }

          Change the number of tries and or sleep time to whatever you like.  For example, if you change number of tries to 9, it would take at most 90 seconds.

          I hope this helps

        • #57721
          Julie Kimmel
          Participant

            Hi Rick,

            I don’t have a ‘reply’ for your post, but just a question for you…

            I am trying to figure out how to do windows batch using the tcl…and I am having a hard time.

            Would you mind sharing a bare bones batch script, a ‘hello world’ if you will, of how to do such a thing? I, too, want to check the status of a thread (which I can only figure out through tcl) and  down it (which I can only figure out through batch) I just can’t figure out how to combine them.

            Thank you,

            Julie Kimmel

          • #57722
            Rick Martin
            Participant

              Hi Julie,

              I’m sure there are other ways to do this, but here’s what we do.  In the bat file, we call the TCL script using parameters passed into the bat file.  The %1 is the site id and %2 is the filename for the TCL script.  Here’s what’s in the bat file:

              call quovadxqdx5.3integratorsbinsetroot quovadxqdx5.3integrator %1

              cd quovadxqdx5.3integratorbin

              hcitcl %2

              In the TCL script, we have a proc to check the status of a thread:

              proc isThreadUp {tname} {

                 set reply [msiGetStatSample tname]

                 catch {keylget reply PSTATUS} result

                 if {$result == “up”} {

                     return 1

                 } else {

                     return 0

                 }

              }

              and also procs to start and stop threads:

              proc startThread {pname tname} {

                 set cmd “pstart”

                 catch {exec cmd.exe /c hcicmd -p $pname -c “$tname $cmd”} result

              }

              proc stopThread {pname tname} {

                 set cmd “pstop”

                 catch {exec cmd.exe /c hcicmd -p $pname -c “$tname $cmd”} result

              }

              At the beginning of the TCL script you also need to have:

              msiAttach

              I hope that helps.

              Rick

          Viewing 2 reply threads
          • The forum ‘Cloverleaf’ is closed to new topics and replies.