Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating parameter subscription does not respect original update_on_expiration #26

Open
merose opened this issue Aug 3, 2023 · 1 comment

Comments

@merose
Copy link

merose commented Aug 3, 2023

To reproduce:

  1. Set up MDB to have a container with defined telemetry rate.
  2. Set up at least two parameters, X and Y in the container.
  3. Create a parameter subscription to X, specifying update_on_expiration=True.
  4. Add Y to the subscription.
  5. Manipulate telemetry to exhibit expiration of the container.

Expected result: Parameters X and Y both get updates with validity_status = EXPIRED.

Actual result: X gets updates with validity_status=EXPIRED, but Y does not.

@fqqb
Copy link
Member

fqqb commented Nov 8, 2023

Hmm, I cannot reproduce this issue.

With following code:

from time import sleep

from yamcs.client import YamcsClient


def print_data(data):
    for parameter in data.parameters:
        print(parameter, parameter.validity_status)


client = YamcsClient("localhost:8090")
processor = client.get_processor("simulator", "realtime")

print("\nReceive callbacks")

subscription = processor.create_parameter_subscription(
    ["/YSS/SIMULATOR/BatteryVoltage1"],
    on_data=print_data,
    update_on_expiration=True,
)

sleep(5)

print("Adding extra items to the existing subscription...")
subscription.add(["/YSS/SIMULATOR/BatteryVoltage2"])

# Manually disable TM link

sleep(30)

I get this as example output:

Receive callbacks
2023-11-08 21:41:26.824000+01:00 /YSS/SIMULATOR/BatteryVoltage1 27 27 [CRITICAL] ACQUIRED
2023-11-08 21:41:27.820000+01:00 /YSS/SIMULATOR/BatteryVoltage1 28 28 [CRITICAL] ACQUIRED
2023-11-08 21:41:28.820000+01:00 /YSS/SIMULATOR/BatteryVoltage1 30 30 [CRITICAL] ACQUIRED
2023-11-08 21:41:29.820000+01:00 /YSS/SIMULATOR/BatteryVoltage1 29 29 [CRITICAL] ACQUIRED
2023-11-08 21:41:30.824000+01:00 /YSS/SIMULATOR/BatteryVoltage1 29 29 [CRITICAL] ACQUIRED
2023-11-08 21:41:31.820000+01:00 /YSS/SIMULATOR/BatteryVoltage1 31 31 [CRITICAL] ACQUIRED
Adding extra items to the existing subscription...
2023-11-08 21:41:31.820000+01:00 /YSS/SIMULATOR/BatteryVoltage2 31 63 [CRITICAL] ACQUIRED
2023-11-08 21:41:32.820000+01:00 /YSS/SIMULATOR/BatteryVoltage1 30 30 [CRITICAL] ACQUIRED
2023-11-08 21:41:32.820000+01:00 /YSS/SIMULATOR/BatteryVoltage2 29 59 [CRITICAL] ACQUIRED
2023-11-08 21:41:33.824000+01:00 /YSS/SIMULATOR/BatteryVoltage1 29 29 [CRITICAL] ACQUIRED
2023-11-08 21:41:33.824000+01:00 /YSS/SIMULATOR/BatteryVoltage2 29 59 [CRITICAL] ACQUIRED
2023-11-08 21:41:34.820000+01:00 /YSS/SIMULATOR/BatteryVoltage1 27 27 [CRITICAL] ACQUIRED
2023-11-08 21:41:34.820000+01:00 /YSS/SIMULATOR/BatteryVoltage2 31 63 [CRITICAL] ACQUIRED
2023-11-08 21:41:35.820000+01:00 /YSS/SIMULATOR/BatteryVoltage1 29 29 [CRITICAL] ACQUIRED
2023-11-08 21:41:35.820000+01:00 /YSS/SIMULATOR/BatteryVoltage2 29 59 [CRITICAL] ACQUIRED
2023-11-08 21:41:35.820000+01:00 /YSS/SIMULATOR/BatteryVoltage2 29 59 [CRITICAL] EXPIRED
2023-11-08 21:41:35.820000+01:00 /YSS/SIMULATOR/BatteryVoltage1 29 29 [CRITICAL] EXPIRED

As you can see, both BatteryVoltage1 and BatteryVoltage2 receive an EXPIRED update (which occurs soon after disabling the relevant TM link).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants