ComfyUI icon indicating copy to clipboard operation
ComfyUI copied to clipboard

File "asyncio\proactor_events.py", line 165, in _call_connection_lost

Open stephantual opened this issue 1 year ago • 2 comments

When you have multiple tabs open (edge/win11/all latest everything inc. comfy) -you get random: File "asyncio\proactor_events.py", line 165, in _call_connection_lost when browsing other tabs, i found youtube was a good one to repeat this message.

The full dump is


Exception in callback _ProactorBasePipeTransport._call_connection_lost(None)
handle: <Handle _ProactorBasePipeTransport._call_connection_lost(None)>
Traceback (most recent call last):
  File "asyncio\events.py", line 80, in _run
  File "asyncio\proactor_events.py", line 165, in _call_connection_lost
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

AFAIK it's non-fatal but it's certainly new - wasn't doing that as of a week ago.

I hope this helps a bit.

stephantual avatar Feb 17 '24 18:02 stephantual

Same here

Voinay avatar Oct 05 '24 16:10 Voinay

修改asyncio\windows_events.py文件,把 DefaultEventLoopPolicy = WindowsProactorEventLoopPolicy 修改成 DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy

yang1010x avatar Nov 05 '24 17:11 yang1010x

修改asyncio\windows_events.py文件,把 DefaultEventLoopPolicy = WindowsProactorEventLoopPolicy 修改成 DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy

该文件地址在哪

CCCjj219166 avatar Nov 27 '24 10:11 CCCjj219166

修改asyncio\windows_events.py文件,把 DefaultEventLoopPolicy = WindowsProactorEventLoopPolicy 修改成 DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy

Instead of directly modifying the Python file, it is recommended to add windows_selector_event_loop_policy=True to ComfyUI-Manager/config.ini.

ltdrdata avatar Nov 27 '24 12:11 ltdrdata

修改asyncio\windows_events.py文件,把 DefaultEventLoopPolicy = WindowsProactorEventLoopPolicy 修改成 DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy

Instead of directly modifying the Python file, it is recommended to add windows_selector_event_loop_policy=True to ComfyUI-Manager/config.ini.

ComfyUI-Manager not have config.ini, and I add config.ini copy windows_selector_event_loop_policy=True in it and error still there.

xueqing0622 avatar Mar 07 '25 03:03 xueqing0622

Got idea from https://www.cnblogs.com/zongdeiqianxing/p/17107077.html , modified main.py under ComfyUI root folder.

find code os.name == "nt" and added one line (see the last line below)

it should be this:

if os.name == "nt":

logging.getLogger("xformers").addFilter(lambda record: 'A matching Triton is not available' not in record.getMessage())

asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) # line added

xueqing0622 avatar Mar 07 '25 03:03 xueqing0622

Confirming for anyone who has the same issue, both these options work.

I've just changed the config.ini which is in ComfyUI\user\default\ComfyUI-Manager

ArctiXArts avatar Mar 09 '25 12:03 ArctiXArts

Confirming for anyone who has the same issue, both these options work.

I've just changed the config.ini which is in ComfyUI\user\default\ComfyUI-Manager

thx, ArctiXArts, find the path and fixed the promblem.

xueqing0622 avatar Mar 10 '25 01:03 xueqing0622

This should be stickied somewhere I just experienced this issue today

geocine avatar Mar 11 '25 10:03 geocine

确认给任何遇到相同问题的人,这两个选项都有效。 我刚刚修改了位于 ComfyUI\user\default\ComfyUI-Manager 的 config.ini 文件。

谢谢,ArctiXArts 找到了路径并解决了问题。

However, a new problem arises: when windows_selector_event_loop_policy is set to True, it will force the system to use the old SelectorEventLoop, which causes compatibility issues with the video preview function of ComfyUI-VideoHelperSuite, and the video preview function will fail to load.

xiaobai9009 avatar Oct 17 '25 02:10 xiaobai9009

这样改确实不报错了,但远程的预览图不能显示

doubley2000 avatar Oct 19 '25 12:10 doubley2000