1.13 regression? Task.async_stream + Stream.run in different process

I have the following code, which simulates a “worker queue”:

stream = Enum.map(~w(a b c), fn x ->
          fn -> IO.puts("Executing #{x}") end
        end) |> Task.async_stream(& &1.())

Task.start(Stream, :run, [stream])

In Elixir 1.12, this executes Stream.start/1 in a task, resulting in the output:

{:ok, #PID<0.133.0>}
Executing a
Executing b
Executing c
iex(12)> 

However, in 1.13, the same code results in a timeout error:

15:13:36.087 [error] Task #PID<0.174.0> started from #PID<0.110.0> terminating
** (stop) exited in: Task.Supervised.stream(5000)
    ** (EXIT) time out
    (elixir 1.13.0) lib/task/supervised.ex:295: Task.Supervised.stream_reduce/7
    (elixir 1.13.0) lib/stream.ex:649: Stream.run/1

I am probably doing something illegal here?

3 Likes

It is a bug. I will address it shortly.

7 Likes

Fixed in master and v1.13. Planning to do a new release this week.

16 Likes

That was fast :smiley: thanks a lot again!

on Elixir 1.13.0 from Index of debian/dists/focal
I am bitten by the bug
is it corrected in 1.13.1 ?
thanks

Yes, it is.

1 Like