mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-06 04:54:29 +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)
|
||||
|
||||
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
|
||||
{:node_started, init_ref, ^child_node, child_port, primary_pid} ->
|
||||
Port.demonitor(port_ref)
|
||||
|
@ -122,11 +124,8 @@ defmodule Livebook.Runtime.Standalone do
|
|||
|
||||
{:DOWN, ^port_ref, :port, _object, reason} ->
|
||||
{:error,
|
||||
"Elixir terminated unexpectedly, please check your logs for errors. Reason: #{inspect(reason)}"}
|
||||
after
|
||||
# Use a longer timeout to account for longer child node startup.
|
||||
30_000 ->
|
||||
{:error, "connection timed out"}
|
||||
"standalone runtime node (#{inspect(child_node)}) terminated unexpectedly on startup, " <>
|
||||
"please check your logs for errors. Reason: #{inspect(reason)}"}
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -165,8 +164,8 @@ defmodule Livebook.Runtime.Standalone do
|
|||
after
|
||||
10_000 ->
|
||||
IO.puts(
|
||||
"Error: timeout during initial communication between standalone runtime" <>
|
||||
" (node: #{inspect(node())}) and Livebook (node: #{inspect(parent_node)})."
|
||||
"Error: timeout during initial communication between standalone runtime " <>
|
||||
"(node: #{inspect(node())}) and Livebook (node: #{inspect(parent_node)})."
|
||||
)
|
||||
|
||||
:timeout
|
||||
|
|
Loading…
Add table
Reference in a new issue