File tree Expand file tree Collapse file tree
graalpython/graalpy_graalos_standalone_payload Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -227,6 +227,12 @@ bin/graalpy --graalhost.run_snapshot=/path/to/persistIso...
227227Restoring a snapshot uses the saved process state. It does not take additional
228228Python command-line arguments on the same invocation.
229229
230+ When ` allow_signal_self_snapshot ` is enabled, the launcher keeps the generated
231+ expanded endpoint config under ` tmp/graalpy-sandbox.* ` instead of deleting it
232+ at process exit. Snapshot restore needs that original directory to remain
233+ available because the saved endpoint configuration records it as
234+ ` endpoint_config_path ` .
235+
230236### Show Graalhost Diagnostics
231237
232238For launcher-level troubleshooting:
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ config="${standalone_home}/config.json"
6767tmp_root=" ${standalone_home} /tmp"
6868launcher_verbose=false
6969launcher_show_help=false
70+ cleanup_tmpdir=true
7071
7172if [ ! -x " $graalhost " ]; then
7273 echo " missing or non-executable GraalHost binary: $graalhost " >&2
@@ -94,8 +95,17 @@ if [ -z "$tmp_base" ] || [ ! -d "$tmp_base" ]; then
9495 tmp_base=" $tmp_root "
9596fi
9697
98+ # Snapshot restore reuses the endpoint config persisted in the snapshot. When
99+ # self-snapshotting is enabled, keep the generated config directory so the
100+ # snapshotted endpoint_config_path still exists on resume.
101+ if grep -Eq ' ^[[:space:]]*"allow_signal_self_snapshot"[[:space:]]*:[[:space:]]*true([[:space:]]*[,}])' " $config " ; then
102+ cleanup_tmpdir=false
103+ fi
104+
97105tmpdir=" $( mktemp -d " ${tmp_base} /graalpy-sandbox.XXXXXXXXXX" ) "
98- trap ' rm -rf "$tmpdir"' EXIT
106+ if [ " $cleanup_tmpdir " = " true" ]; then
107+ trap ' rm -rf "$tmpdir"' EXIT
108+ fi
99109endpoint_config=" ${tmpdir} /config.json"
100110" $expand_config " " $standalone_home " " $config " " $endpoint_config "
101111
You can’t perform that action at this time.
0 commit comments