吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 568|回复: 2
收起左侧

[学习记录] python sanic 服务启动失败处理经验

[复制链接]
chendm 发表于 2023-11-16 23:13
python sanic 服务器启动失败 [INFO] Server Stopped 问题处理
[Python] 纯文本查看 复制代码
[2023-11-16 17:58:55 +0800] [7287] [DEBUG] Starting a process: Sanic-Server-0-0
[2023-11-16 17:58:56 +0800] [7287] [DEBUG] Starting a process: Sanic-Reloader-0
[2023-11-16 17:59:03 +0800] [7287] [ERROR] Not all workers are ack. Shutting down.
[2023-11-16 17:59:03 +0800] [7287] [ERROR] Experienced exception while trying to serve
Traceback (most recent call last):
  File "/data/pyenv/pysanic3/lib/python3.9/site-packages/sanic/mixins/startup.py", line 851, in serve
    manager.run()
  File "/data/pyenv/pysanic3/lib/python3.9/site-packages/sanic/worker/manager.py", line 63, in run
    self.monitor()
  File "/data/pyenv/pysanic3/lib/python3.9/site-packages/sanic/worker/manager.py", line 99, in monitor
    self.wait_for_ack()
  File "/data/pyenv/pysanic3/lib/python3.9/site-packages/sanic/worker/manager.py", line 139, in wait_for_ack
    sys.exit(1)
SystemExit: 1
[2023-11-16 17:59:03 +0800] [7287] [INFO] Server Stopped

解决方法:
/data/pyenv/pysanic3/lib/python3.9/site-packages/sanic/worker/manager.py  
manager.py  文件的 line 139, in wait_for_ack 相关语句注释掉
[Python] 纯文本查看 复制代码
    def wait_for_ack(self):  # no cov
        misses = 0
        while not self._all_workers_ack():
            sleep(0.1)
            misses += 1
            # if misses > self.THRESHOLD:
            #     error_logger.error("Not all workers are ack. Shutting down.")
            #     self.kill()
            #     sys.exit(1)


遇到相同问题的同学可以借鉴 一下了。


发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

sai609 发表于 2023-11-17 00:18
没有遇到这问题
 楼主| chendm 发表于 2023-11-29 14:19
sai609 发表于 2023-11-17 00:18
没有遇到这问题

是我摸索出来的,可以解决这个问题,也许新版本修正了此问题
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-24 18:56

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表