You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In all cases, the signal metadata should be communicated to the consumers of the signals prior to sending the values. This ensures the widget can prepare proper context for the data coming in.
Current Behavior
In cases where the signal is connecting for the first time after listeners have already been added, it's possible for the value callback to fire prior to the metadata callback.
Possible Solution
Add some sort of blocking/deferring mechanism, holding back all value callbacks until the first valid metadata callback is received.
Steps to Reproduce (for bugs)
Create an EpicsSignal with enum strings
Use it right away in a PyDMComboboxWidget prior to it being fully connected
This may be a race condition and may not happen every time.
I fear yet another callback queue that piles up while waiting for some EPICS connection to establish 💀
This is probably the right path though, I might just suggest we have a timeout on how long those value callbacks can dwell. When the value callback fires first, is the state unrecoverable? Or could we refresh the view and get everything working again?
ZLLentz
changed the title
Metadata handling for non-yet-connected signals
Metadata handling for not-yet-connected signals
Jun 25, 2024
Yeah, we could easily get into trouble here...
In some cases this doesn't matter at all, most of the time when it matters it results in some annoying terminal spam. I'm not sure if this is ever fatal.
It's pretty minor as far as I can tell.
Rather than hold up the callback queue, I'd do something like:
Value cb comes in, but no meta yet
Cache the value cb and don't emit
More value cbs come in before metadata? Just overwrite the cached value
First metadata comes through? Emit the cached value afterwards
Expected Behavior
In all cases, the signal metadata should be communicated to the consumers of the signals prior to sending the values. This ensures the widget can prepare proper context for the data coming in.
Current Behavior
In cases where the signal is connecting for the first time after listeners have already been added, it's possible for the value callback to fire prior to the metadata callback.
Possible Solution
Add some sort of blocking/deferring mechanism, holding back all value callbacks until the first valid metadata callback is received.
Steps to Reproduce (for bugs)
EpicsSignal
with enum stringsThis may be a race condition and may not happen every time.
Context
Discovered while testing #616
Your Environment
typhos branch from the linked PR with the following critical package versions from pydm (plus my ophyd version):
The text was updated successfully, but these errors were encountered: