Skip to content

recompute_status: single responsibility principle (recompute, don't get)#693

Merged
PawelPlesniak merged 13 commits intodevelopfrom
jamesturner246/simpler_recompute_status
Nov 21, 2025
Merged

recompute_status: single responsibility principle (recompute, don't get)#693
PawelPlesniak merged 13 commits intodevelopfrom
jamesturner246/simpler_recompute_status

Conversation

@jamesturner246
Copy link
Contributor

@jamesturner246 jamesturner246 commented Nov 14, 2025

Description

Resolves #685.

The key point of this PR is to simplify recompute_status to do just that: recompute, not get. The reason this is important is that, since recompute_status is a state-modifying RPC, it is subject to node exclusion policy, unlike the regular status RPC. Consequently recompute_status returns an incomplete status tree, CF the one returned by status. Now, if status is required after recomputing, one must call status after their recompute_status call.

Note: recompute_status still calls status internally, but only on it's direct children and subject to child exclusion policy. This still reduces the number of redundant status calls in a single recompute_status call, compared to before.

Also a few other changes:

  • ignore_exclusion (ambiguous) -> include_excluded_nodes
  • finish merging ClientSideChild into RESTAPIChildNode entirely
  • a few missing protobuf message types from earlier for status, describe, describe_fsm, include, exclude...

Type of change

  • Documentation (non-breaking change that adds or improves the documentation)
  • New feature (non-breaking change which adds functionality)
  • Optimization (non-breaking, back-end change that speeds up the code)
  • Bug fix (non-breaking change which fixes an issue)
  • Breaking change (whatever its nature)

Key checklist

  • All tests pass (eg. python -m pytest)
  • Pre-commit hooks run successfully (eg. pre-commit run --all-files)

Further checks

  • Code is commented, particularly in hard-to-understand areas
  • Tests added or an issue has been opened to tackle that in the future.
    (Indicate issue here: # (issue))

@PawelPlesniak
Copy link
Collaborator

Thanks James, this PR helps clean up the logic nicely. Here are some logs to demonstrate the functinoality. Note - the command to-error does not operate on the daq_application processes, as no interface has been defined, and the applicaitons themselves also do not have this functionality.

[2025/11/21 11:09:36] INFO       commands.py:80                 unified_shell.boot:                           Booted successfully                                                                                                                                                                                                                                                                                                                                                                                                                                                       
drunc-unified-shell > to-error --help
Usage: PROCESS_MANAGER CONFIGURATION_FILE CONFIGURATION_ID SESSION_NAME to_error 
           [OPTIONS]

Options:
  --target TEXT                   The target to address
  --execute-along-path / --dont-execute-along-path
                                  Execute the command along the path
                                  [default: execute-along-path]
  --execute-on-all-subsequent-children-in-path / --dont-execute-on-all-subsequent-children-in-path
                                  Execute the command on all subsequent
                                  children in the path  [default: execute-on-
                                  all-subsequent-children-in-path]
  --help                          Show this message and exit.
drunc-unified-shell > to-error --target root-controller
drunc-unified-shell > recompute-status
drunc-unified-shell > status
                                              pawel status                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:30006 │
│   df-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:37571 │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:51005 │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45091 │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45509 │
│   hsi-fake-controller  │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:45683 │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:42543 │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:56199 │
│   ru-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:44391 │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43381 │
│   trg-controller       │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:41197 │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39735 │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39525 │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴───────────────────────────┘
[2025/11/21 11:09:50] INFO       shell_utils.py:165             utils.ShellContext:                           Current FSM status is initial. Available transitions are conf. Available sequence commands are start-run.                                                                                                                                                                                                                                                                                                                                                                 
drunc-unified-shell > to-error --target root-controller
drunc-unified-shell > status
                                              pawel status                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.73.136.38:30006 │
│   df-controller        │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.73.136.38:37571 │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:51005 │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45091 │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45509 │
│   hsi-fake-controller  │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.73.136.38:45683 │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:42543 │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:56199 │
│   ru-controller        │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.73.136.38:44391 │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43381 │
│   trg-controller       │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.73.136.38:41197 │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39735 │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39525 │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴───────────────────────────┘
[2025/11/21 11:09:54] ERROR      shell_utils.py:154             utils.ShellContext:                            FSM is in error (state: "initial"                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                 sub_state: "initial"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                 in_error: true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                 included: true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                 ), not currently accepting new commands.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
drunc-unified-shell > recompute-status
drunc-unified-shell > status
                                              pawel status                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:30006 │
│   df-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:37571 │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:51005 │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45091 │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45509 │
│   hsi-fake-controller  │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:45683 │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:42543 │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:56199 │
│   ru-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:44391 │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43381 │
│   trg-controller       │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:41197 │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39735 │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39525 │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴───────────────────────────┘
[2025/11/21 11:09:58] INFO       shell_utils.py:165             utils.ShellContext:                           Current FSM status is initial. Available transitions are conf. Available sequence commands are start-run.                                                                                                                                                                                                                                                                                                                                                                 
drunc-unified-shell > to-error --help
Usage: PROCESS_MANAGER CONFIGURATION_FILE CONFIGURATION_ID SESSION_NAME to_error 
           [OPTIONS]

Options:
  --target TEXT                   The target to address
  --execute-along-path / --dont-execute-along-path
                                  Execute the command along the path
                                  [default: execute-along-path]
  --execute-on-all-subsequent-children-in-path / --dont-execute-on-all-subsequent-children-in-path
                                  Execute the command on all subsequent
                                  children in the path  [default: execute-on-
                                  all-subsequent-children-in-path]
  --help                          Show this message and exit.
drunc-unified-shell > to-error --target root-controller --dont-execute-on-all-subsequent-children-in-path
drunc-unified-shell > status
                                              pawel status                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.73.136.38:30006 │
│   df-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:37571 │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:51005 │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45091 │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45509 │
│   hsi-fake-controller  │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:45683 │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:42543 │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:56199 │
│   ru-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:44391 │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43381 │
│   trg-controller       │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:41197 │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39735 │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39525 │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴───────────────────────────┘
[2025/11/21 11:10:37] ERROR      shell_utils.py:154             utils.ShellContext:                            FSM is in error (state: "initial"                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                 sub_state: "initial"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                 in_error: true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                 included: true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                 ), not currently accepting new commands.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
drunc-unified-shell > recompute-status
drunc-unified-shell > status
                                              pawel status                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:30006 │
│   df-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:37571 │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:51005 │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45091 │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45509 │
│   hsi-fake-controller  │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:45683 │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:42543 │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:56199 │
│   ru-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:44391 │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43381 │
│   trg-controller       │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:41197 │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39735 │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39525 │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴───────────────────────────┘
[2025/11/21 11:10:42] INFO       shell_utils.py:165             utils.ShellContext:                           Current FSM status is initial. Available transitions are conf. Available sequence commands are start-run.                                                                                                                                                                                                                                                                                                                                                                 
drunc-unified-shell > to-error --target df-controller
drunc-unified-shell > status
                                              pawel status                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.73.136.38:30006 │
│   df-controller        │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.73.136.38:37571 │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:51005 │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45091 │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45509 │
│   hsi-fake-controller  │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:45683 │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:42543 │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:56199 │
│   ru-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:44391 │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43381 │
│   trg-controller       │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:41197 │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39735 │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39525 │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴───────────────────────────┘
[2025/11/21 11:10:58] ERROR      shell_utils.py:154             utils.ShellContext:                            FSM is in error (state: "initial"                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                 sub_state: "initial"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                 in_error: true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                 included: true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                 ), not currently accepting new commands.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
drunc-unified-shell > recompute-status
drunc-unified-shell > status
                                              pawel status                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:30006 │
│   df-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:37571 │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:51005 │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45091 │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45509 │
│   hsi-fake-controller  │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:45683 │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:42543 │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:56199 │
│   ru-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:44391 │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43381 │
│   trg-controller       │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:41197 │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39735 │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39525 │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴───────────────────────────┘
[2025/11/21 11:11:05] INFO       shell_utils.py:165             utils.ShellContext:                           Current FSM status is initial. Available transitions are conf. Available sequence commands are start-run.                                                                                                                                                                                                                                                                                                                                                                 
drunc-unified-shell > to_error --help
Command not found: to_error --help
drunc-unified-shell > to-error --help
Usage: PROCESS_MANAGER CONFIGURATION_FILE CONFIGURATION_ID SESSION_NAME to_error 
           [OPTIONS]

Options:
  --target TEXT                   The target to address
  --execute-along-path / --dont-execute-along-path
                                  Execute the command along the path
                                  [default: execute-along-path]
  --execute-on-all-subsequent-children-in-path / --dont-execute-on-all-subsequent-children-in-path
                                  Execute the command on all subsequent
                                  children in the path  [default: execute-on-
                                  all-subsequent-children-in-path]
  --help                          Show this message and exit.
drunc-unified-shell > to-error --target df-controller --dont-execute-along-path --dont-execut-on-all-subsequent-children-in-path
Usage: PROCESS_MANAGER CONFIGURATION_FILE CONFIGURATION_ID SESSION_NAME to_error 
           [OPTIONS]
Try 'PROCESS_MANAGER CONFIGURATION_FILE CONFIGURATION_ID SESSION_NAME to_error --help' for help.

Error: No such option: --dont-execut-on-all-subsequent-children-in-path (Possible options: --dont-execute-along-path, --dont-execute-on-all-subsequent-children-in-path, --execute-on-all-subsequent-children-in-path)
drunc-unified-shell > to-error --target df-controller --dont-execute-along-path --dont-execute-on-all-subsequent-children-in-path
drunc-unified-shell > status
                                              pawel status                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:30006 │
│   df-controller        │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.73.136.38:37571 │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:51005 │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45091 │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45509 │
│   hsi-fake-controller  │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:45683 │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:42543 │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:56199 │
│   ru-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:44391 │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43381 │
│   trg-controller       │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:41197 │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39735 │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39525 │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴───────────────────────────┘
[2025/11/21 11:11:48] INFO       shell_utils.py:165             utils.ShellContext:                           Current FSM status is initial. Available transitions are conf. Available sequence commands are start-run.                                                                                                                                                                                                                                                                                                                                                                 
drunc-unified-shell > recompute-status
drunc-unified-shell > status
                                              pawel status                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:30006 │
│   df-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:37571 │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:51005 │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45091 │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45509 │
│   hsi-fake-controller  │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:45683 │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:42543 │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:56199 │
│   ru-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:44391 │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43381 │
│   trg-controller       │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:41197 │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39735 │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39525 │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴───────────────────────────┘
[2025/11/21 11:11:51] INFO       shell_utils.py:165             utils.ShellContext:                           Current FSM status is initial. Available transitions are conf. Available sequence commands are start-run.                                                                                                                                                                                                                                                                                                                                                                 
drunc-unified-shell > to-error --target df-01 --dont-execute-along-path --dont-execute-on-all-subsequent-children-in-path
drunc-unified-shell > status
                                              pawel status                                              
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                  ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:30006 │
│   df-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:37571 │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:51005 │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45091 │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:45509 │
│   hsi-fake-controller  │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:45683 │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:42543 │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:56199 │
│   ru-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:44391 │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43381 │
│   trg-controller       │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:41197 │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39735 │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:39525 │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴───────────────────────────┘
[2025/11/21 11:12:15] INFO       shell_utils.py:165             utils.ShellContext:                           Current FSM status is initial. Available transitions are conf. Available sequence commands are start-run. 

@PawelPlesniak
Copy link
Collaborator

One thing would be good to look at, when targeting a daq_application with recompute-status, the target does not work as intended. We should discuss what could be possible, and if this is something that is outside the reach of our control we can leave some notes in the helpstring and leave it as is.

drunc-unified-shell > recompute-status --target df-01 --execute-along-path
drunc-unified-shell > status
                                              pawel status                                               
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                   ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.244.21.208:30006 │
│   df-controller        │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.73.136.38:41031  │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:33747  │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:60349  │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43111  │
│   hsi-fake-controller  │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:37461  │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:46299  │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:57295  │
│   ru-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:35835  │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:47621  │
│   trg-controller       │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:43191  │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43261  │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:49681  │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴────────────────────────────┘
[2025/11/21 11:21:32] INFO       shell_utils.py:165             utils.ShellContext:                           Current FSM status is initial. Available transitions are conf. Available sequence commands are start-run. 

@PawelPlesniak
Copy link
Collaborator

I think it would also be useful to have an warning message when a target is not found

drunc-unified-shell > status
                                              pawel status                                               
┏━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┳━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name                   ┃ Info ┃ State   ┃ Substate ┃ In error ┃ Included ┃ Endpoint                   ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━╇━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ root-controller        │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.244.21.208:30006 │
│   df-controller        │      │ initial │ initial  │ Yes      │ Yes      │ grpc://10.73.136.38:41031  │
│     df-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:33747  │
│     dfo-01             │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:60349  │
│     tp-stream-writer   │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43111  │
│   hsi-fake-controller  │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:37461  │
│     hsi-fake-01        │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:46299  │
│     hsi-fake-to-tc-app │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:57295  │
│   ru-controller        │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:35835  │
│     ru-01              │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:47621  │
│   trg-controller       │      │ initial │ initial  │ No       │ Yes      │ grpc://10.73.136.38:43191  │
│     mlt                │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:43261  │
│     tc-maker-1         │      │ initial │ idle     │ No       │ Yes      │ rest://10.73.136.38:49681  │
└────────────────────────┴──────┴─────────┴──────────┴──────────┴──────────┴────────────────────────────┘
[2025/11/21 11:32:50] ERROR      shell_utils.py:154             utils.ShellContext:                            FSM is in error (state: "initial"                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                 sub_state: "initial"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                                 in_error: true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                 included: true                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
                                 ), not currently accepting new commands.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
drunc-unified-shell > recompute-status --target no-exist

@PawelPlesniak
Copy link
Collaborator

TODO - make a user story of how we want execute along path to work

Copy link
Collaborator

@PawelPlesniak PawelPlesniak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awaiting comments from the US before merging

Copy link
Collaborator

@PawelPlesniak PawelPlesniak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@PawelPlesniak PawelPlesniak merged commit d72f0e5 into develop Nov 21, 2025
3 checks passed
@PawelPlesniak PawelPlesniak deleted the jamesturner246/simpler_recompute_status branch November 21, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: consider removing status calls from controller recompute_status

3 participants