GSF-12 IndependentActionAdapterManagerBase fixes#356
Merged
ritchiecarroll merged 3 commits intomasterfrom Jan 21, 2025
Merged
Conversation
ritchiecarroll
approved these changes
Jan 21, 2025
Member
ritchiecarroll
left a comment
There was a problem hiding this comment.
Changes look simple enough, but I have not tested - presume you have - so approving on that condition.
Member
Author
|
Yeah, I couldn't even figure out what the problem was without extensive testing. 😩 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
DataSourceleading to mismatches.If you specify inputs manually by signal ID,
InputMeasurementKeysmight 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
DataSourceis updated. If a child adapter was already initialized in a prior configuration update, the child adapter will be skipped and theadapterscollection can no longer be used to reliably determine what theCurrentAdapterIndexis.As an example, consider the case where
ADAPTER1is at index 0 andADAPTER2is at index 1. If you enableADAPTER2after the bulk calculator was already initialized, the child adapter forADAPTER1would already be initialized. Therefore, initialization of the child adapter forADAPTER1would be skipped, andadapters.Countis still 0. When initializing the child adapter forADAPTER2, the base class informs the subclass thatCurrentAdapterIndexis 0 so the subclass mistakenly returns the device ID forADAPTER1.