-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug in upload_calculation
when running with store_provenance=False
#3513
Fix bug in upload_calculation
when running with store_provenance=False
#3513
Conversation
…alse` When running a `CalcJob` in dry-run mode, it is often advised to also set `store_provenance=False` which means nodes will not be stored, so input nodes can be unstored. However, in `upload_calculation` to process the `local_copy_list` the `load_node` function was used to load the corresponding node, which would fail in this scenario. The only possible solution is to pass the full mapping of inputs to the function and if the loading of the node fails, try to fish out the corresponding node from the mapping. If all fails, we emit a warning and skip the rule.
|
||
try: | ||
data_node = load_node(uuid=uuid) | ||
except exceptions.NotExistent: | ||
logger.warning('failed to load Node<{}> specified in the `local_copy_list`'.format(uuid)) | ||
data_node = find_data_node(inputs, uuid) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to allow this in general or only when dry_run=True
?
Also, maybe good to add a comment line to both 188 and 190
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was wondering about that too, but I just kept the current behavior for now where it just emits a warning log. We might want to change this to actually raise. If the plugin specified that a the contents of a node need to be copied over and it is not there, that should be a problem and most likely the calculation should not work. I am not sure in what use case a mere warning is the desired alternative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @sphuber !
logic of the find_data_node
function looks good - just one question regarding its usage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, up to you whether to raise there or not - I'd be ok with these changes.
Fixes #3511
When running a
CalcJob
in dry-run mode, it is often advised to also setstore_provenance=False
which means nodes will not be stored, so inputnodes can be unstored. However, in
upload_calculation
to process thelocal_copy_list
theload_node
function was used to load thecorresponding node, which would fail in this scenario. The only possible
solution is to pass the full mapping of inputs to the function and if
the loading of the node fails, try to fish out the corresponding node
from the mapping. If all fails, we emit a warning and skip the rule.