mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-06 19:46:00 +08:00
Explicitly halt standalone runtime (#2587)
This commit is contained in:
parent
3d289448cd
commit
81d803d564
1 changed files with 5 additions and 1 deletions
|
@ -116,6 +116,9 @@ defmodule Livebook.Runtime.StandaloneInit do
|
||||||
# Note Windows does not handle escaped quotes and newlines the same way as Unix,
|
# Note Windows does not handle escaped quotes and newlines the same way as Unix,
|
||||||
# so the string cannot have constructs newlines nor strings. That's why we pass
|
# so the string cannot have constructs newlines nor strings. That's why we pass
|
||||||
# the parent node name as ARGV and write the code avoiding newlines.
|
# the parent node name as ARGV and write the code avoiding newlines.
|
||||||
|
#
|
||||||
|
# Also note that we explicitly halt, just in case `System.no_halt(true)` is
|
||||||
|
# called within the runtime.
|
||||||
@child_node_eval_string """
|
@child_node_eval_string """
|
||||||
[parent_node] = System.argv();\
|
[parent_node] = System.argv();\
|
||||||
init_ref = make_ref();\
|
init_ref = make_ref();\
|
||||||
|
@ -126,7 +129,8 @@ defmodule Livebook.Runtime.StandaloneInit do
|
||||||
receive do {:DOWN, ^manager_ref, :process, _object, _reason} -> :ok end;\
|
receive do {:DOWN, ^manager_ref, :process, _object, _reason} -> :ok end;\
|
||||||
after 10_000 ->\
|
after 10_000 ->\
|
||||||
:timeout;\
|
:timeout;\
|
||||||
end\
|
end;\
|
||||||
|
System.halt()\
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if @child_node_eval_string =~ "\n" do
|
if @child_node_eval_string =~ "\n" do
|
||||||
|
|
Loading…
Add table
Reference in a new issue