Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions deployment/aliyun/polymarket-raw-ops-shadow-gate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,11 @@ memory_events_end_json=$(memory_events_json "$memory_events_end") \
|| die 'could not serialize the final Rust shadow memory.events snapshot'
systemctl kill --kill-whom=main --signal=SIGTERM "$shadow_unit" \
|| die 'could not terminate the frozen Rust shadow main process'
systemctl thaw "$shadow_unit" \
|| die 'could not thaw the Rust shadow before its final stop'
shadow_thawed_state=$(systemctl show --property=FreezerState --value "$shadow_unit")
[[ $shadow_thawed_state == running ]] \
|| die 'Rust shadow did not leave the frozen state before its final stop'
systemctl stop "$shadow_unit"
verify_no_restart_after_cursor "$shadow_unit" "$shadow_stop_cursor" "$shadow_invocation_id" \
|| die 'Rust shadow journal recorded a restart during final stop'
Expand Down
12 changes: 11 additions & 1 deletion deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1242,19 +1242,29 @@ final_memory_line=$(grep -n '^memory_events_end=$(stable_memory_events_snapshot'
| tail -1 | cut -d: -f1)
kill_line=$(grep -n '^systemctl kill --kill-whom=main --signal=SIGTERM' "$GATE" \
| cut -d: -f1)
final_thaw_line=$(grep -n '^systemctl thaw "$shadow_unit"' "$GATE" \
| tail -1 | cut -d: -f1 || true)
thawed_state_line=$(grep -n '^shadow_thawed_state=.*FreezerState' "$GATE" \
| cut -d: -f1 || true)
final_stop_line=$(grep -n '^systemctl stop "$shadow_unit"$' "$GATE" | tail -1 | cut -d: -f1)
[[ $freeze_line =~ ^[1-9][0-9]*$ \
&& $freezer_state_line =~ ^[1-9][0-9]*$ \
&& $final_memory_line =~ ^[1-9][0-9]*$ \
&& $kill_line =~ ^[1-9][0-9]*$ \
&& $final_thaw_line =~ ^[1-9][0-9]*$ \
&& $thawed_state_line =~ ^[1-9][0-9]*$ \
&& $final_stop_line =~ ^[1-9][0-9]*$ \
&& $freeze_line -lt $freezer_state_line \
&& $freezer_state_line -lt $final_memory_line \
&& $final_memory_line -lt $kill_line \
&& $kill_line -lt $final_thaw_line \
&& $final_thaw_line -lt $thawed_state_line \
&& $thawed_state_line -lt $final_stop_line \
&& $kill_line -lt $final_stop_line ]] || {
printf 'shadow final freeze/snapshot/kill/stop sequence is unsafe\n' >&2
printf 'shadow final freeze/snapshot/kill/thaw/stop sequence is unsafe\n' >&2
exit 1
}
grep -Fq '[[ $shadow_thawed_state == running ]]' "$GATE"

validator_functions="$tmp_dir/control-group-validator.sh"
sed -n '/^valid_absolute_path() {$/,/^}$/p' "$GATE" >"$validator_functions"
Expand Down
Loading