GSF-12 IndependentActionAdapterManagerBase fixes #356
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The queue of input measurement keys was unnecessary, because the synchronized operation was copying the reference to a local variable anyway. However, by keeping an old collection of input measurement keys in the queue, the adapter is much more likely to use an old collection of inputs against an updated
DataSource
leading to mismatches.If you specify inputs manually by signal ID,
InputMeasurementKeys
might end up with a measurement key for an inactive measurement. This results in an error:By filtering inactive measurements early, we avoid these types of errors. We also avoid potential desyncs between the base class and the subclass during initialization. It's unlikely that an adapter developer would want an inactive measurement in their adapter, since they can't even query metadata for it from
ActiveMeasurements
.The bulk calculation adapter updates its configuration whenever the
DataSource
is updated. If a child adapter was already initialized in a prior configuration update, the child adapter will be skipped and theadapters
collection can no longer be used to reliably determine what theCurrentAdapterIndex
is.As an example, consider the case where
ADAPTER1
is at index 0 andADAPTER2
is at index 1. If you enableADAPTER2
after the bulk calculator was already initialized, the child adapter forADAPTER1
would already be initialized. Therefore, initialization of the child adapter forADAPTER1
would be skipped, andadapters.Count
is still 0. When initializing the child adapter forADAPTER2
, the base class informs the subclass thatCurrentAdapterIndex
is 0 so the subclass mistakenly returns the device ID forADAPTER1
.