Stabilize metadata deadline mutation gate
This commit is contained in:
@@ -29,7 +29,7 @@ cleanup() {
|
||||
}
|
||||
trap cleanup EXIT
|
||||
mkdir -p "$site/components" "$work" "$root/run" "$root/session" "$root/upload"
|
||||
sed -E '/^[[:space:]]*(BIN_DIRECTORY|PRECOMPILE_FILES_IN|SITE_DIRECTORY|FCGI_SOCKET_PATH|FCGI_PORT|CLI_SOCKET_PATH|WS_BROKER_SOCKET_PATH|HTTP_PORT|HTTP_DOCUMENT_ROOT|SESSION_PATH|TMP_UPLOAD_PATH|WASM_CORE_PATH|WASM_INVOCATION_TIMEOUT_MS|WASM_EPOCH_PERIOD_MS|PROACTIVE_COMPILE_ENABLED|WORKER_COUNT)[[:space:]]*=/d' \
|
||||
sed -E '/^[[:space:]]*(BIN_DIRECTORY|PRECOMPILE_FILES_IN|SITE_DIRECTORY|FCGI_SOCKET_PATH|FCGI_PORT|CLI_SOCKET_PATH|WS_BROKER_SOCKET_PATH|HTTP_PORT|HTTP_DOCUMENT_ROOT|SESSION_PATH|TMP_UPLOAD_PATH|WASM_CORE_PATH|WASM_INVOCATION_TIMEOUT_MS|WASM_EPOCH_PERIOD_MS|PROACTIVE_COMPILE_ENABLED|SERVE_LAST_KNOWN_GOOD|SHOW_DYNAMIC_COMPILE_ERRORS|WORKER_COUNT)[[:space:]]*=/d' \
|
||||
/etc/uce/settings.cfg >"$settings"
|
||||
cat >>"$settings" <<CFG
|
||||
BIN_DIRECTORY=$work
|
||||
@@ -44,9 +44,11 @@ HTTP_DOCUMENT_ROOT=$site
|
||||
SESSION_PATH=$root/session
|
||||
TMP_UPLOAD_PATH=$root/upload
|
||||
WASM_CORE_PATH=$(pwd)/bin/wasm/core.wasm
|
||||
WASM_INVOCATION_TIMEOUT_MS=100
|
||||
WASM_INVOCATION_TIMEOUT_MS=1000
|
||||
WASM_EPOCH_PERIOD_MS=10
|
||||
PROACTIVE_COMPILE_ENABLED=0
|
||||
SERVE_LAST_KNOWN_GOOD=0
|
||||
SHOW_DYNAMIC_COMPILE_ERRORS=1
|
||||
WORKER_COUNT=1
|
||||
CFG
|
||||
mount --bind "$settings" /etc/uce/settings.cfg
|
||||
@@ -259,14 +261,14 @@ wait_ready() {
|
||||
prepare_deadline
|
||||
deadline_wasm="$cache/components/deadline.uce.wasm"
|
||||
deadline_counter="$root/deadline.counter"
|
||||
printf '%s delay 150 - - %s\n' "$deadline_wasm" "$deadline_counter" >"$control"
|
||||
printf '%s delay 1100 - - %s\n' "$deadline_wasm" "$deadline_counter" >"$control"
|
||||
started=$(date +%s%N)
|
||||
set +e
|
||||
deadline_output=$(request target=components/deadline.uce 2>&1)
|
||||
set -e
|
||||
elapsed_ms=$(( ($(date +%s%N) - started) / 1000000 ))
|
||||
[[ "$deadline_output" == *UCE_INVOCATION_TIMEOUT:* ]] || { echo "metadata scan lacked canonical timeout: $deadline_output" >&2; exit 1; }
|
||||
(( elapsed_ms >= 100 && elapsed_ms < 2000 )) || { echo "metadata timeout took ${elapsed_ms}ms" >&2; exit 1; }
|
||||
(( elapsed_ms >= 1000 && elapsed_ms < 3000 )) || { echo "metadata timeout took ${elapsed_ms}ms" >&2; exit 1; }
|
||||
[[ $(wc -l <"$deadline_counter") -eq 1 ]] || { echo "metadata scanner read past the first delayed refill" >&2; exit 1; }
|
||||
rm -f "$control"
|
||||
[[ "$(request health=1)" == "$worker_pid|health" ]]
|
||||
@@ -275,14 +277,14 @@ restore deadline
|
||||
|
||||
rm -f "$cache/components/deadline.uce.cwasm"
|
||||
touch "$deadline_wasm"
|
||||
printf '%s delay 150 - - %s\n' "$deadline_wasm" "$root/full-deadline.counter" >"$control"
|
||||
printf '%s delay 1100 - - %s\n' "$deadline_wasm" "$root/full-deadline.counter" >"$control"
|
||||
started=$(date +%s%N)
|
||||
set +e
|
||||
full_deadline_output=$(request target=components/deadline.uce 2>&1)
|
||||
set -e
|
||||
elapsed_ms=$(( ($(date +%s%N) - started) / 1000000 ))
|
||||
[[ "$full_deadline_output" == *UCE_INVOCATION_TIMEOUT:* ]] || { echo "full artifact read lacked canonical timeout: $full_deadline_output" >&2; exit 1; }
|
||||
(( elapsed_ms >= 100 && elapsed_ms < 2000 )) || { echo "full artifact timeout took ${elapsed_ms}ms" >&2; exit 1; }
|
||||
(( elapsed_ms >= 1000 && elapsed_ms < 3000 )) || { echo "full artifact timeout took ${elapsed_ms}ms" >&2; exit 1; }
|
||||
[[ $(wc -l <"$root/full-deadline.counter") -eq 1 ]] || { echo "full artifact reader continued after the first delayed chunk" >&2; exit 1; }
|
||||
rm -f "$control"
|
||||
[[ "$(request health=1)" == "$worker_pid|health" ]]
|
||||
|
||||
Reference in New Issue
Block a user