tortoise-orm
tortoise-orm copied to clipboard
An error occurs when using the save method to save data : concurrent.futures._base.CancelledError
Describe the bug Method of saving data using tortoise ORM: await XXX.save() Then errors will be reported in the execution process, not every time. It is an accidental phenomenon.
The version used is tortoise-orm==0.17.7
To Reproduce
Additional context File "/handler/trigger_handler.py", line 116, in deal_no await check_res.save() File "/usr/local/lib/python3.7/site-packages/tortoise/models.py", line 943, in save await executor.execute_update(self, update_fields) File "/usr/local/lib/python3.7/site-packages/tortoise/backends/base/executor.py", line 317, in execute_update self.get_update_sql(update_fields, arithmetic_or_function), values File "/usr/local/lib/python3.7/site-packages/tortoise/backends/mysql/client.py", line 44, in translate_exceptions_ return await func(self, *args) File "/usr/local/lib/python3.7/site-packages/tortoise/backends/mysql/client.py", line 199, in execute_query await cursor.execute(query, values) File "/usr/local/lib/python3.7/site-packages/aiomysql/cursors.py", line 239, in execute await self._query(query) File "/usr/local/lib/python3.7/site-packages/aiomysql/cursors.py", line 457, in _query await conn.query(q) File "/usr/local/lib/python3.7/site-packages/aiomysql/connection.py", line 428, in query await self._read_query_result(unbuffered=unbuffered) File "/usr/local/lib/python3.7/site-packages/aiomysql/connection.py", line 622, in _read_query_result await result.read() File "/usr/local/lib/python3.7/site-packages/aiomysql/connection.py", line 1105, in read first_packet = await self.connection._read_packet() File "/usr/local/lib/python3.7/site-packages/aiomysql/connection.py", line 561, in _read_packet packet_header = await self._read_bytes(4) File "/usr/local/lib/python3.7/site-packages/aiomysql/connection.py", line 598, in _read_bytes data = await self._reader.readexactly(num_bytes) File "/usr/local/lib/python3.7/asyncio/streams.py", line 679, in readexactly await self._wait_for_data('readexactly') File "/usr/local/lib/python3.7/asyncio/streams.py", line 473, in _wait_for_data await self._waiter concurrent.futures._base.CancelledError
Please take the time to take a look. Thank you very much
Try latest version
Try latest version
Thank you for your reply. I will try the latest version
Try latest version I tried the latest version and still reported this error.Please take a moment to have a look and reply me