Skip to content

Commit d445884

Browse files
committed
LOGC-63: Strip ANSI color codes from supervisord status output
ochinchina/supervisord wraps each 'ctl status' line in ANSI color escape codes. The consumer-restart path's awk lookup matched on '^<proc>_[0-9]+', which never matched because the line actually started with the escape sequence, so a stuck consumer could not be restarted.
1 parent 211bf36 commit d445884

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/scripts/wait-for-backbeat-lifecycle.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,12 @@ check_consumer_stable() {
7171
# ctl uses the same socket as the running daemon. ochinchina's
7272
# restart expects the process name (e.g. lifecycle-bucket-processor_0
7373
# for numprocs=1), not the program name, so look it up via
74-
# status rather than hardcoding the suffix.
74+
# status rather than hardcoding the suffix. ochinchina prints
75+
# status with ANSI color codes (e.g. \x1b[0;32m...\x1b[0m), so
76+
# strip them before matching with awk.
7577
local proc
7678
proc=$(docker exec workbench-backbeat supervisord ctl -c /conf/supervisord.conf status \
79+
| sed 's/\x1b\[[0-9;]*m//g' \
7780
| awk "/^${proc_prefix}_[0-9]+[[:space:]]/ {print \$1; exit}")
7881
if [ -z "$proc" ]; then
7982
echo "ERROR: ${proc_prefix} not found in supervisord status"

0 commit comments

Comments
 (0)