Skip to content

#258 Add the equipmentID to CommandTag update so DAQ can look it up

Alexandros Papageorgiou Koufidis requested to merge 258-cmd-update-server into master

For context, see #258

The problem

Reconfiguring a CommandTag on a running DAQ caused crashes. After the investigation, it was discovered that the DAQ received a CommandTag without an equipmentId, and threw an exception because of that.

The DAQ side

The DAQ does have the information to look up the CommandTag through its equipments but that is very costly - it's essentially name matching the command against the entire Tag Space, the total of tags available in all equipments and subequipments that are part of the DAQ. Not very optimal.

The client side

As a result, the best approach seemed to be to build a mechanism on the client side that infers and injects the equipment ID to each CommandTag before it's sent to the JMS queue. I built this, only to figure out the problem persisted.

The right (server) side

It turned out that the server was dropping the equipment ID on purpose from the CommandTagUpdate, even if the client included it. According to the following code snippet, this seems to be part of a general non-support for equipment ID changes after the initial configuration (the CommandTag builder api is also missing the equipmentId method, apparently on purpose)

See the following code from CommandTagConfigHandler

log.trace("Updating CommandTag {}", id);
    //reject if trying to change equipment it is attached to - not currently allowed
    if (properties.containsKey("equipmentId")) {
      log.warn("Attempting to change the equipment to which a command is attached - this is not currently supported!");
      properties.remove("equipmentId");
    }

Summary of changes:

  • The behavior of refusing equipment ID changes "on the fly" has been maintained
  • The server will now inject the equipment ID that is already cached in memory to the CommandTagUpdate object, before the ActiveMQ routes it to the DAQ.
  • The DAQ layer has been left unchanged
  • The client layer has been left unchanged

Closes #258

Edited by Matthias Braeger

Merge request reports