onyx

FYI: alternative Onyx :onyx: chat is at <https://gitter.im/onyx-platform/onyx> ; log can be found at <https://clojurians-log.clojureverse.org/onyx/index.html>
dbernal 2018-03-15T15:58:29.000246Z

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?

2018-03-15T17:32:53.000699Z

michaeldrogalis 2018-03-15T17:56:03.000372Z

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

dbernal 2018-03-15T18:02:21.000168Z

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

lucasbradstreet 2018-03-15T18:03:00.000603Z

@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.

lucasbradstreet 2018-03-15T18:03:52.000042Z

@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.

dbernal 2018-03-15T18:05:43.000242Z

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?

lucasbradstreet 2018-03-15T18:08:35.000247Z

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

lucasbradstreet 2018-03-15T18:09:31.000669Z

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

lucasbradstreet 2018-03-15T18:09:51.000616Z

Support for that is currently on our backlog.

dbernal 2018-03-15T18:27:09.000782Z

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?

lucasbradstreet 2018-03-15T18:28:31.000565Z

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.

dbernal 2018-03-15T18:33:52.000527Z

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