Explicitly halt standalone runtime (#2587)

This commit is contained in:
Jonatan Kłosko 2024-04-29 16:43:00 +02:00 committed by GitHub
parent 3d289448cd
commit 81d803d564
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -116,6 +116,9 @@ defmodule Livebook.Runtime.StandaloneInit do
# 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
# 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 """
[parent_node] = System.argv();\
init_ref = make_ref();\
@ -126,7 +129,8 @@ defmodule Livebook.Runtime.StandaloneInit do
receive do {:DOWN, ^manager_ref, :process, _object, _reason} -> :ok end;\
after 10_000 ->\
:timeout;\
end\
end;\
System.halt()\
"""
if @child_node_eval_string =~ "\n" do