-
-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The user actively cancels the request, the task is canceled by CancelledError(), and the connection object or cursor recovery fails, causing the new SQL query to get the SQL result of the previous request. #103
Comments
Hello, please give me a minimum reproducible example. |
Okay, let me now use the simplest example to reproduce the problem
Here is my test interface
Here is my test script:
In the above script file, the result can be obtained normally by initiating 100 asynchronous requests. When I change the cancel_request method to the following:
After another 100 requests were made, when asyncmy connected to mysql to obtain data, the client withdrew the request, causing the interface to report an error.The log is as follows:
The above is my own test script. I don’t know if I need to call conn.rollback(), but even if I call rollback(), an error will be reported. |
I use the sanic framework and tortoise-orm==0.19.1. It uses the asyncmy package by default. As a result, when the client cancels the request, the connection is disordered. The current request sql is the sql of the previous interface. Query the results, and then tortoise gets the data for mapping, and the result reports keyerror.
log:
The source code of tortoise’s import package is as follows:
The text was updated successfully, but these errors were encountered: