fix no cfg xtrig broadcast delta shutdown#6936
Closed
dwsutherland wants to merge 2 commits intocylc:8.5.xfrom
Closed
fix no cfg xtrig broadcast delta shutdown#6936dwsutherland wants to merge 2 commits intocylc:8.5.xfrom
dwsutherland wants to merge 2 commits intocylc:8.5.xfrom
Conversation
Member
|
Member
Author
Actually yes, my solution was a bit coarse .. I'm pushing another |
c43bedf to
d98efe8
Compare
dwsutherland
commented
Aug 27, 2025
| j_cfg[key] = val | ||
| j_buf.runtime.CopyFrom(runtime_from_config(j_cfg)) | ||
| else: | ||
| j_buf.runtime.CopyFrom(tproxy.runtime) |
Member
Author
There was a problem hiding this comment.
Toyed about with creating a function that is less rigid and can use existing store objects as a base..
def runtime_from_partial(rtconfig, runtimeold=None):
"""Populate runtime object from partial/full config.
Potentially slower with all the setattr calls, but less argvar assignments
than `runtime_from_config`.
"""
runtime = PbRuntime()
if runtimeold is not None:
runtime.CopyFrom(runtimeold)
for key, val in rtconfig.items():
if key not in RUNTIME_MAPPING:
continue
elif key in RUNTIME_LIST_JOINS:
setattr(runtime, RUNTIME_MAPPING[key], listjoin(val))
elif key in RUNTIME_JSON_DUMPS:
setattr(
runtime,
RUNTIME_MAPPING[key],
json.dumps(
{'key': k, 'value': v}
for k, v in val.items()
)
)
elif key in RUNTIME_TRY_ITEMS:
try:
setattr(
runtime,
RUNTIME_MAPPING[key],
val[RUNTIME_TRY_ITEMS[key]]
)
except (KeyError, TypeError):
setattr(runtime, RUNTIME_MAPPING[key], val)
elif key in RUNTIME_STRINGIFYS:
setattr(runtime, RUNTIME_MAPPING[key], str(val or ''))
else:
setattr(runtime, RUNTIME_MAPPING[key], val)
return runtime
but setattr doesn't seem to be playing nice with these objects (will find out why), and maybe it's slower anyway..
Member
Author
There was a problem hiding this comment.
Test giving:
elif key in RUNTIME_STRINGIFYS:
setattr(runtime, RUNTIME_MAPPING[key], str(val or ''))
else:
> setattr(runtime, RUNTIME_MAPPING[key], val)
E TypeError: bad argument type for built-in operation
protobuf objects can be a little finnicky about how fields are assigned/activated sometimes
Member
Author
|
Duplicate of #6817 |
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.
So this occurred on workflow reload after xtrigger removal:
This could happen with an orphaned running task, to mitigate I've handled this and similar calls in the data-store to carry on with an empty runtime item.
Check List
CONTRIBUTING.mdand added my name as a Code Contributor.setup.cfg(andconda-environment.ymlif present).?.?.xbranch.