Fork me on GitHub
#onyx
<
2018-03-15
>
dbernal15:03:29

Would a downstream task emit twice if it has two upstream tasks given that it has a trigger that would only fire if it sees a job-completed event-type?

michaeldrogalis17:03:03

@dbernal Nope, it wouldn't. A job-completed event doesn't "flow" through the tasks

dbernal18:03:21

ah ok. So when would a trigger observe a job-completed event-type?

lucasbradstreet18:03:00

@dbernal a job completed event will be fired when all of the input sources signal “completed”, and all messages are fully flushed through the pipeline.

lucasbradstreet18:03:52

@dbernal the only time a job-completed even could/should be seen more than once is if there is a fault before it fully completes, and the job restarts from a checkpoint.

dbernal18:03:43

ok that makes sense. So if the input tasks complete then a trigger listening for a job-complete would fire off right? Let's say I have input tasks leading to function tasks that lead to an aggregation task. In this instance how would I be able to determine that all the segments have flowed through the function tasks into the aggregation task?

lucasbradstreet18:03:35

That’s right but as I said a day or two ago, you can’t currently depend on job-completed for trigger/emit, only trigger/sync

lucasbradstreet18:03:31

To do so would require onyx adding an extra stage to the job completion workflow, to ensure the segments get flushed downstream.

lucasbradstreet18:03:51

Support for that is currently on our backlog.

dbernal18:03:09

gotcha. Thanks for the explanation, it's taking a few times of hearing it to understand what's happening 😄. So is there any way that I can tell the downstream tasks when to fire? Maybe using a punctuation trigger listening on a particular "end" segment?

lucasbradstreet18:03:31

That’d do it. That’s what we’ve done in other projects thus far to work around the problem, but it does have some limitations in that you need to ensure that all the channels (inputs, tasks, etc) are flushed in order to do it right.

dbernal18:03:52

ok got it. I'll look into that then. Thanks for all the help!