Fork me on GitHub
#onyx
<
2016-10-09
>
Drew Verlee14:10:04

i have what i suspect to be a problem with a blocking core async channel. Noobishly, I dont see how how my test differs from the example i see in learn onyx 6_1 example. In my code their isn’t the “bind-inputs” function, however, that just puts elements on the channel. In my program this is done directly inside the body of my test. I’m not sure how to troubleshoot the issue as the only feedback i get is that the program hangs, as i would expect if i put to many items on the channel. However the channel size is very large (10,000) and i dont see what mechanism prevents this in the learning onyx example. https://github.com/onyx-platform/learn-onyx/blob/master/test/workshop/jobs/challenge_6_1_test.clj I’m hoping this is a 10 second diagnosis for someone with more experience with core.async (which is the aspect i think im confused about). Dont spend any longer then that on it 🙂

lucasbradstreet14:10:51

@drewverlee I have a guess about what’s going on. Give me a bit, just got back from a run.

lucasbradstreet15:10:47

@drewverlee can you try onyx 0.9.12-20161009.151014-2?

lucasbradstreet15:10:19

Pretty sure it’s only opening a channel of size 1000, due to a bug in the core async plugin

Drew Verlee15:10:15

I'll try it when I get back to my comp in an hour or so

Drew Verlee17:10:24

@lucasbradstreet i said 10,000 but i mean 1000 as is defined here https://github.com/onyx-platform/onyx/blob/75a48ce99f7d9cc829ea27922d987617abc7c5ac/src/onyx/tasks/core_async.clj > can you try onyx 0.9.12-20161009.151014-2? I’m not sure what that means

lucasbradstreet17:10:38

That’s the new snapshot version number for Onyx. It’s a fixed snapshot version

lucasbradstreet17:10:05

At what point is it hanging?

Drew Verlee17:10:24

the last print statment i get get to fire is after the promise is supposed to be delievered Starting Onyx test environment false false Trigger for :collect-heating-and-cooling window #inst "2016-10-14T04:00:00.000-00:00" #inst "2016-10-14T04:04:59.999-00:00" promise checked promise true after promise

(add-watch c/fired-window-state :watcher
                   (fn [k r old new]
                     (let [n (swap! n-trigger-fires inc)]

                       (println "promise checked")
                       ;; This time, we have 1
                       ;; buckets - so we wait for 1 updates.
                       
                       (when (= n 1)
                         (deliver p true)
                         (println "promise true"))
                       (println "after promise"))))

Drew Verlee19:10:24

so adding (>!! in :done) seems to stop it from hanging. I was 90% sure i wasn’t closing the channel correctly, or rather, that the channel was blocking and i assumed that was the cause of the hang.

Travis19:10:01

:done is the sentinel used to tell onyx there is no more data incoming

Drew Verlee19:10:26

I suppose i was looking for where in the code thats actual … done 🙂.

Drew Verlee19:10:41

but knowing is good enough for now.

Drew Verlee19:10:27

i felt like that was one of the first things i tried, but i must of mucked it up with another change.

Travis19:10:02

It's basically built into the core async plugin