hcicyclesavemsgs not cycling similarly named threads

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf hcicyclesavemsgs not cycling similarly named threads

  • Creator
    Topic
  • #55409
    Jared Parish
    Participant

      Over the years, I’ve had an issue with hcicyclesavemsgs not cycling SMAT files if that thread was named similar to another.  I’ve finally taken the time to figure out the issue with hcicyclesavemsgs.  I couldn’t find mention of this in clovertech, so I thought I’d post this.  Take this example:

      Issue

      A site name hello_world has the following threads (among others):

    • to_cerner_adt

      to_cerner


    • When hcicyclesavemsgs runs, the logs would show the following.  Notice is tries to cycle to_cerner_adt twice.

      Code:

      Processing
         Root: /hci/cis6.1/integrator, site: hello_world, proc: hello_world, thread: to_cerner_adt
      20170523.23:55:46 Cycling saved IB msg file to_cerner_adt.ibsv
         cmd: hcicmd -v -p hello_world -c ‘to_cerner_adt save_cycle in’ >>/dev/null 2>&1
      20170523.23:55:46 Backing up idx & msg files.
      20170523.23:55:46 Deleting old backup idx & msg files:
      20170523.23:55:46 Cycling saved OB msg file to_cerner_adt.obsv
         cmd: hcicmd -v -p hello_world -c ‘to_cerner_adt save_cycle out’ >>/dev/null 2>&1
      20170523.23:55:46 Backing up idx & msg files.
      20170523.23:55:47 Deleting old backup idx & msg files:

      Processing
         Root: /hci/cis6.1/integrator, site: hello_world, proc: hello_world, thread: to_cerner_adt
      20170523.23:55:47 No saved IB msg file for this thread
      20170523.23:55:47 No saved OB msg file for this thread

      Cause

      Within the ckconnStatus subroutine in hcicyclesavemsgs, a regular expression was matching the longer of the two threads.  

      Code:

      /^protocol ($connS*).*$/

      Resolution

      I thought a better regular expression was:

      Code:

      /^protocol ($conn)s{/

      This regular expression more explicitly matches the line it is trying to match.  That is, it matches the line in the NetConfig that starts the definition of a thread (i.e. “protocol to_cerner {“). The other resolution would be to rename the thread to something dissimilar.

      The full subroutine code with fix:

      Code:

      sub ckconnStatus {
      #; check connection status
      open(NETCONFIG,”grep ‘^protocol’ $netconfig |”) || return 0;
      @NETCONFIG = ;
      close(NETCONFIG);
      foreach $proc (@procs) {
      open(CONNSTATUS,”hciconnstatus |grep ‘^$proc ‘ |”)
      || die “Cannot access hciconnstatus”;
      $procpath = $rootpath . “/” . $site . “/exec/processes/” . $proc;
      while () {
      chop;
      if (/^S+s+(S+)s+ups+S+.*$/) {
      ($conn) = $1;
      foreach (@NETCONFIG) {
      $NCline = $_;
      chop($NCline);
      if ($NCline =~ /^protocol ($conn)s{/) {
      ($conn) = $1;
        printf(”nProcessingn    Root: %s, site: %s, proc: %s, thread: %sn”,$rootpath,$site,$proc,$conn);
      last;
      }
      }
      &ckSavemsgs;
      }
      }
      close(CONNSTATUS);
        }
      return 1;
      }

      - Jared Parish

    • The forum ‘Cloverleaf’ is closed to new topics and replies.