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
Queries start failing after some time #67
Comments
Are you sure that error is generated by P.S. Please don't use global variables, push aoipg pool into
in request handler def handler(request): |
The http requests that do not depend on database work perfectly fine. |
No, global variables are not related to your issue. |
I have a similar situation. The process works great for extended periods of time, but then suddenly the database connection stops working. In my log I see only the following: 2015-09-24 02:04:31,841 asyncio ERROR Fatal error on aiopg connection: bad state in _ready callback I'm giong to be trying to add more error recovery and logging code, so if I learn anything more I'll update. |
By the way, I get 10 copies of that message in my log one right after the other. I presume it is one for each connection in the pool. |
Is any way to reproduce this? We had similar issue with aiomysql due to MySQL server connection timeout, successfully fixed in aio-libs/aiomysql#27 |
I don't have a reproducer yet, but the data I have so far indicates it is probably a result of a timeout on the DB connection. I'm planning to try to create a reproducer once I have more data. |
My case appears to be a consequence of #65. The reproducer in that issue produces the same kind of traceback that I'm seeing in my applicaion, which I now catch and ignore. Then 30 seconds later I get the bad state in _ready. I'll investigate fixing this, but it will probably be a week or more before I can circle back to this problem. |
@asvetlov i was able to reproduce this scenario and basically it was due to timeoutError. but there is a suggestion https://github.com/aio-libs/aiopg/blob/master/aiopg/connection.py#L182 could you make it to execute in asyncio.sheild() and change cancel() method accordingly, atleast in this case it will ensure that future gets executed properly even if timeout or cancelledError occurs |
@pankajnits thanks for good news! I don't follow your suggestion, sorry. |
@asvetlov its good that cancel is ensured , but out of curiosity i wanted to ask that what if we can ensure future is shielded irrespective of timeouts. |
also will it help in solving #65 |
in case of waiter being timedout and scheduled for cancellation, i can see that there are queries in postgres db that are in "idle" state |
Simulate load error. The error manifests itself only when the load increases. |
I've the same issue with a big load when I launch a benchmark on any project based on aiopg. |
If somebody has a solution for that, I'm interested in, I'm working for the round 12 of FrameworkBenchmarks. |
Is this issue still present? We've been looking for an asynchronous wrapper for Postgres access, but this would probably be a show-stopper. |
Looks like this issue was fixed. @asvetlov could you confirm? |
I believe we we have solved the issue. |
I am facing an issue where my db queries start failing after sometime. Here is some code that I use to create a pool
I use aiohttp to create a web server and once the server is up and running for a few hours, db quesries start failing. All other apis work perfectly fine. Here are the logs attached:
The text was updated successfully, but these errors were encountered: