3.75K 浏览
0

阿里云1核ECS运行,报无法创建新线程。

最初运行正常,运行一段时间后就报出这个错误。

请问这个跟系统核心数有关系吗?至少要求2核以上?

Traceback (most recent call last):
File “xxx.py”, line 169, in run
self.api.wait_update()
File “/myhome/anaconda3/envs/lab/lib/python3.7/site-packages/tqsdk/api.py”, line 894, in wait_update
self._run_once()
File “/myhome/anaconda3/envs/lab/lib/python3.7/site-packages/tqsdk/api.py”, line 1524, in _run_once
raise self._exceptions.pop(0)
File “/myhome/anaconda3/envs/lab/lib/python3.7/site-packages/tqsdk/api.py”, line 1593, in _connect
async with websockets.connect(url, **keywords) as client:
File “/myhome/anaconda3/envs/lab/lib/python3.7/site-packages/websockets/client.py”, line 517, in __aenter__
return await self
File “/myhome/anaconda3/envs/lab/lib/python3.7/site-packages/websockets/client.py”, line 535, in __await_impl__
transport, protocol = await self._create_connection()
File “/myhome/anaconda3/envs/lab/lib/python3.7/asyncio/base_events.py”, line 913, in create_connection
type=socket.SOCK_STREAM, proto=proto, flags=flags, loop=self)
File “/myhome/anaconda3/envs/lab/lib/python3.7/asyncio/base_events.py”, line 1290, in _ensure_resolved
proto=proto, flags=flags)
File “/myhome/anaconda3/envs/lab/lib/python3.7/asyncio/base_events.py”, line 792, in getaddrinfo
None, getaddr_func, host, port, family, type, proto, flags)
File “/myhome/anaconda3/envs/lab/lib/python3.7/asyncio/base_events.py”, line 755, in run_in_executor
executor.submit(func, *args), loop=self)
File “/myhome/anaconda3/envs/lab/lib/python3.7/concurrent/futures/thread.py”, line 172, in submit
self._adjust_thread_count()
File “/myhome/anaconda3/envs/lab/lib/python3.7/concurrent/futures/thread.py”, line 193, in _adjust_thread_count
t.start()
File “/myhome/anaconda3/envs/lab/lib/python3.7/threading.py”, line 852, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can’t start new thread

west 已回答的问题 2020年4月17日
0

这个不是tqsdk报的错,你可以查一下RuntimeError: can’t start new thread 的原因和解决方案

west 已回答的问题 2020年4月17日