Closed amano-kenji closed 1 month ago
Hard to say for certain yet (I'm looking into this) but I think the issue is with channel/from-each
looking for specific errors and then calling propagate.
I'm thinking that I'm using ev/select
wrong. In the above example, ev/select
is called twice on the same channel.
So on latest master, this seems to work as expected (as I expected). I wrapped every call to ev/go
and ev/spawn
with tracev
so we can see which fibers are created, and then added this bit of code to monitor which fibers are active:
(forever
(ev/sleep 1)
(def all-tasks (ev/all-tasks))
(def me (fiber/root))
(def sans-self (seq [t :in all-tasks :when (not= me t)] t))
(printf "%n" sans-self))
At the end, a single fiber is left running that corresponds to the loop that is reading from the supervisor channel via (ev/spawn (forever ...))
Closing as cannot reproduce, please reopen if still an issue.
In production code, when
ev/select
is called again, It even runsdefer
forms after they are run once...... They shouldn't be run again.... Because of this issue, I eliminatedchannel/from-each
andev/select
in my production code.This is my minimal example.
Output is
I noticed that the iterable task of
channel/from-each
was not really cancelled becauseev/select
didn't return a value inchannel/from-each
.