mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-11 23:44:23 +08:00
Improve messages on standalone runtime init failure (#2912)
This commit is contained in:
parent
e01abae5e8
commit
f20b2c6f8d
1 changed files with 6 additions and 7 deletions
|
@ -108,6 +108,8 @@ defmodule Livebook.Runtime.Standalone do
|
||||||
port_ref = Port.monitor(port)
|
port_ref = Port.monitor(port)
|
||||||
|
|
||||||
loop = fn loop ->
|
loop = fn loop ->
|
||||||
|
# Note that the child node terminates when communication times out,
|
||||||
|
# so we should always receive either a message or :DOWN event.
|
||||||
receive do
|
receive do
|
||||||
{:node_started, init_ref, ^child_node, child_port, primary_pid} ->
|
{:node_started, init_ref, ^child_node, child_port, primary_pid} ->
|
||||||
Port.demonitor(port_ref)
|
Port.demonitor(port_ref)
|
||||||
|
@ -122,11 +124,8 @@ defmodule Livebook.Runtime.Standalone do
|
||||||
|
|
||||||
{:DOWN, ^port_ref, :port, _object, reason} ->
|
{:DOWN, ^port_ref, :port, _object, reason} ->
|
||||||
{:error,
|
{:error,
|
||||||
"Elixir terminated unexpectedly, please check your logs for errors. Reason: #{inspect(reason)}"}
|
"standalone runtime node (#{inspect(child_node)}) terminated unexpectedly on startup, " <>
|
||||||
after
|
"please check your logs for errors. Reason: #{inspect(reason)}"}
|
||||||
# Use a longer timeout to account for longer child node startup.
|
|
||||||
30_000 ->
|
|
||||||
{:error, "connection timed out"}
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -165,8 +164,8 @@ defmodule Livebook.Runtime.Standalone do
|
||||||
after
|
after
|
||||||
10_000 ->
|
10_000 ->
|
||||||
IO.puts(
|
IO.puts(
|
||||||
"Error: timeout during initial communication between standalone runtime" <>
|
"Error: timeout during initial communication between standalone runtime " <>
|
||||||
" (node: #{inspect(node())}) and Livebook (node: #{inspect(parent_node)})."
|
"(node: #{inspect(node())}) and Livebook (node: #{inspect(parent_node)})."
|
||||||
)
|
)
|
||||||
|
|
||||||
:timeout
|
:timeout
|
||||||
|
|
Loading…
Add table
Reference in a new issue