#239 - fix portal ensemble submission timing issue#251
Merged
Conversation
this adds a universal subscription channel for all components to solve this problem Signed-off-by: Lance-Drane <Lance-Drane@users.noreply.github.com>
Signed-off-by: Lance-Drane <Lance-Drane@users.noreply.github.com>
markcoletti
reviewed
Jul 14, 2026
| except MaxRetryError as e: | ||
| fail_count += 1 | ||
| conn.send((999, f'Max retry error: {e}')) | ||
| conn.send((NOTEBOOK_MESSAGE_TYPE, next_val['component_id'], 999, f'Max retry error: {e}')) |
There was a problem hiding this comment.
I'm concerned about the magic numbers 999 and -1.
markcoletti
approved these changes
Jul 14, 2026
markcoletti
left a comment
There was a problem hiding this comment.
Looks good, though at some point we should probably make those magic numbers named constants.
|
As stated in an associated comment, we should probably grep through the code and replace magic numbers with named constants or enumerated type values. Not a priority at this point, though. |
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.
This adds a universal subscription channel for all components to solve the timing issue problem. This also fixes the portal bridge logic to continuously poll for responses back from the Portal Data API, which is important for blocking tasks. Currently we only care about confirmation that the ensemble values were uploaded, the notebook + data APIs should be able to remain entirely asynchronous for now.
The basic logic:
The subscription channel can be derived from
f'_IPS_{self.__component_id.get_serialization()}'(need to have the_IPS_prefix or else the logic in the services'subscribefunction will add additional prefixes, which aren't desirable ; importantly, the subscription happens in the__run__function of the Component class, which is never intended to be overridden by user code (unlike theinit,step,terminate,finalizefunctions).