-
Notifications
You must be signed in to change notification settings - Fork 94
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
xtriggers: only first broadcast results recorded #3275
Comments
Ouch, that's bad. I'm pretty sure existing xtrigger tests should be testing this... |
Yep, |
Good news, it is only the logging that is truncated, not the broadcast itself. Running your example as described above (but with
So, all of the xtrigger return values do get broadcast to the task. But the suite log does indeed only show the first. |
The problem seems to be here in 98 for broadcast_change in get_broadcast_change_iter(
99 modified_settings, is_cancel):
100 msg += CHANGE_FMT % broadcast_change Iteration stops at the first item. But I'll leave this to you @sadielbartholomew, as you've assigned yourself and might have worked on it already! |
Doh, somehow I missed that you had already put up a PR for this! (Was going through my GitHub notification emails sequentially). 😬 And you seem to have come to a different conclusion to me. Moving over to #3276 ... |
Thanks for looking into it @hjoliver, it seems like it is a subtle bug.
Sorry for the partial misdiagnosis, I had to stop work before I got onto look at the testing aspect in #3276, at which point I will have realised it was just the logging, though to defend my conclusions before I called it a day:
Anyway, I want to ensure I'm fixing the buggy code rather than inadvertently bodging perfectly fine code to produce the right behaviour, as based on your investigations & reporting comments seems I have likely one in #3276! I'll look into it further & talk to Matt about the logging & then make amendments there accordingly. |
👍 - yes I can absolutely see how you would think, from the evidence, that this must be an xtrigger broadcast bug (not just logging)! |
Don't (blindly) trust the logs is probably the main take-away lesson for me here! 😇 -> skeptical 🎩 |
Describe the bug
Only the first (by ordering) key-value item from the dictionary of results in the success
return
signature of an xtrigger gets broadcast actually gets recorded (logs, DB) as being passed on to dependent tasks, when all items are meant to be recorded as passed on. For example, if an xtrigger call returns(True, {"ONE": "one", "TWO": "two", "THREE": "three"})
, only"ONE": "one"
is logged as passed via an environment variable<xtrigger_name>_ONE=one
.See below for a concrete example.
NB: I have checked & observed that the problem is not present for regular (non-xtrigger) broadcasts, just for broadcasts made by any xtrigger.
Release version(s) and/or repository branch(es) affected?
This bug had been tested for, & found to present, for both
8.0a0
&7.8.3
.Steps to reproduce the bug
results
dict with multiple items, e.g:Apply it in a simple dummy suite, e.g the one in the docs here, with
echo_1 = echo(...)
replaced bysucceeding = succeed(*args)
, wheresucceed.py
is under<suite-dir>/lib/python
.Observe the suite log to only show that the environment variable for the first key, "ONE", has been broadcast:
results
dict & observe that the suite log display changes accordingly, e.g. after moving"TWO:"two"
to the front (to be the zeroth item):Expected behavior
All defined key-value items specified in a (valid)
results
dict get logged & stored in the DB when they are passed to tasks depending on the xtrigger.Screenshots
The 'broadcasts list' page on Cylc Review also supports this, e.g. at step 3 above it shows:
The text was updated successfully, but these errors were encountered: