Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-19579

The same command IDs are being used by different commands

    XMLWordPrintable

    Details

      Description

      It appears that in ts_sal 3.9 every command topic starts with the same private_seqNum (some large integer). As a result the same seqNum is being used by all the different commands.

      Two solutions that come to mind (and I'm sure there are others):

      1) Use another existing ackcmd field or add a field that identifies which command the ack is for. For instance an integer that specifies the index of the command in the known command topics.

      Then one can use a different content-filtered ackcmd reader for each command, for instance in SALPY using the ackCommand_x and getResponse_x functions will do exactly what a user might expect.

      Does SAL provide similar functions for other languages?

      2) Divide the sequence numbers up so that each command has its own range of sequence numbers. Each command writer starts out with the minimum value and rolls over when it hits the maximum.

      This is a simpler change, but it means that code must (continue to) read one ackcmd topic to read acks for all commands. For instance one would use getResponse_start to read acks for all commands, including enable, disable, exitControl... which is surprising, to say the least.

      salobj has not been doing this and so has a subtle bug I need to fix. I wonder how many other languages have the same bug?

      (You could fix the bug using content filtered readers based on seqNum range, but that sounds riskier and hackier than using a separate field to identify the command).

        Attachments

          Issue Links

            Activity

            Hide
            rowen Russell Owen added a comment -

            This was fixed in SAL and ts_salobj (but DM-19697 helps a lot).

            Show
            rowen Russell Owen added a comment - This was fixed in SAL and ts_salobj (but DM-19697 helps a lot).
            Hide
            dmills Dave Mills added a comment -

            Can we close this

            Show
            dmills Dave Mills added a comment - Can we close this
            Hide
            rowen Russell Owen added a comment - - edited

            See also DM-19697: the ackcmd topic does not offer a way to differentiate between ackcmds for a command sent by different remotes.

            What we have done so far (all we could do without changing the ackcmd topic):

            • Use specific ranges of IDs for commands.
            • Use random starting #s to ameliorate DM-19697: it isn't a perfect solution but greatly reduces the odds of a problem.

            SAL 4/salobj 5 will fix DM-19697.

            In other words: this looks good to me. Please close it.

            Show
            rowen Russell Owen added a comment - - edited See also DM-19697 : the ackcmd topic does not offer a way to differentiate between ackcmds for a command sent by different remotes. What we have done so far (all we could do without changing the ackcmd topic): Use specific ranges of IDs for commands. Use random starting #s to ameliorate DM-19697 : it isn't a perfect solution but greatly reduces the odds of a problem. SAL 4/salobj 5 will fix DM-19697 . In other words: this looks good to me. Please close it.

              People

              Assignee:
              dmills Dave Mills
              Reporter:
              rowen Russell Owen
              Reviewers:
              Russell Owen
              Watchers:
              Andrew Heyer [X] (Inactive), Dave Mills, Russell Owen, Tiago Ribeiro
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.