livebook-dev / kino

Client-driven interactive widgets for Livebook
Apache License 2.0
372 stars 65 forks source link

Fix dbg pipeline when result renders as Kino.JS.Live #453

Closed jonatanklosko closed 4 months ago

jonatanklosko commented 4 months ago

Currently a pipeline with Explorer operations and |> dbg() hangs and times out. The pipeline c:Kino.JS.Live.init/1 calls Kino.Frame.render/2, which may result in Kino.start_child/1 underneath. In the past Kino.Frame.render/2 used GenServer.cast, so the init callback would not block, finish and unlock the other Kino.start_child/1. However, we changed Kino.Frame.render/2 to use GenServer.call (https://github.com/livebook-dev/kino/commit/aae7a1b0a22f1b5273a5d058c5831b916513438d), so now init blocks, but the nested Kino.start_child/1 hangs, until init times out.

To fix it, I moved Kino.Frame.render/2 from init to a subsequent handle_info.