Stop a Thread from inside a TCL Script

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Stop a Thread from inside a TCL Script

  • Creator
    Topic
  • #47656
    Amit Anand
    Participant

      Hi

      I am trying to stop the thread from inside my recovery 33 procs if I receive an AR back from the End System.

      I issue the command in my tcl script:

      After setting up the Environment variables ‘setroot & setsite”

      exec  /u01/qdx5.3/integrator/bin/hcicmd -p t_rad_4 -h ax30.sleh.com -c ‘d_heartlab pstop’

      In the Error Log of the process, it says…No Response within timeout…..Assuming Process Hung!!!

      The above command however works perfect when I try to run it from another UNIX script to Stop a specific Thread. It also works fine from the command line.

      Can you suggest any way I can increase the timeout time so that it does not assume the process is hung. Any other suggestions would also be helpful.

      Thanks

      Amit

    Viewing 2 reply threads
    • Author
      Replies
      • #56373
        David Barr
        Participant

          If the thread you are trying to stop is in the same process as the proc that is doing the stopping, I don’t think that any timeout will be sufficient.  When you do a “system” call, the process will not be able to respond to “hcicmd” commands for the duration of the system call.

          You could possibly execute the “hcicmd” in the background (system “hcicmd blah &”), but you would not be able to check the result of the command.

        • #56374
          James Cobane
          Participant

            Amit,

            The way we have handled this in the past is to “touch” a file (named the same as the thread), when we receive an AR/AE response.  We then have an alert that checks for a ‘file status change’ and execs the hci command to shutdown the thread when the ‘file status change’ is true.

            Hope this helps.

            Jim Cobane

            PHNS, Inc.

          • #56375
            Russ Ross
            Participant

              In our recover33 check_reply TPS proc we do the following to stop the outbound thread when it gets a NAK

              Code:

              system “hcicmd -p $process -c “$HciConnName pstop””

              Russ Ross
              RussRoss318@gmail.com

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