ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

taskiq worker阻塞排查记录

2026/8/4 19:27:01 拓冰建站 浏览量
taskiq worker阻塞排查记录

有一个监听clawbot的schedule以及对应的worker,出现收不到用户发送的消息。

实际发送时间:
image

服务处理时间,15:22:46. 是因为在这个点docker restart worker

today=$(date +%F)
for f in /app/api/storage/logs/task_worker/output*; docase "$f" in*.gz) gzip -cd "$f" ;;*) cat "$f" ;;esac
done | grep -nE "^${today} .*(ClawBot 收到最新消息)"
' 2>/dev/null`

929f828f9447014b0ce730c38c5e0abd

三点多进行了重启,重启后可以发现有任务堆积
7885947812f644975fb54cf861226c44

查看cro-beat 推送是否正常:

today=$(date +%F)docker exec cro-beat sh -lc '
for f in /app/api/storage/logs/beat/output*; docase "$f" in*.gz) gzip -cd "$f" ;;*) cat "$f" ;;esac
done
' 2>/dev/null |
awk -v start="${today} 04:00:00" -v end="${today} 16:00:00" \'substr($0,1,19) >= start && substr($0,1,19) < end' |
grep -n 'check_clawbot_updates_schedule'

image

查看cro-worker日志:

docker exec cro-worker sh -lc '
today=$(date +%F)
for f in /app/api/storage/logs/task_worker/output*; docase "$f" in*.gz) gzip -cd "$f" ;;*) cat "$f" ;;esac
done | grep -nE "^${today} .*(_poll_single_clawbot_updates|ClawBot 单账号消息监听)"
![d61dd5f5ee4ff6e4e69aba0d6c9c6df3](https://img2024.cnblogs.com/blog/1892858/202608/1892858-20260804185807462-1195545138.png)

d61dd5f5ee4ff6e4e69aba0d6c9c6df3