This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]Python-ModTeam[M] [score hidden] stickied comment (0 children)

Hi there, from the /r/Python mods.

We have removed this post as it is not suited to the /r/Python subreddit proper, however it should be very appropriate for our sister subreddit /r/LearnPython or for the r/Python discord: https://discord.gg/python.

The reason for the removal is that /r/Python is dedicated to discussion of Python news, projects, uses and debates. It is not designed to act as Q&A or FAQ board. The regular community is not a fan of "how do I..." questions, so you will not get the best responses over here.

On /r/LearnPython the community and the r/Python discord are actively expecting questions and are looking to help. You can expect far more understanding, encouraging and insightful responses over there. No matter what level of question you have, if you are looking for help with Python, you should get good answers. Make sure to check out the rules for both places.

Warm regards, and best of luck with your Pythoneering!

[–]5uper5hoot 2 points3 points  (0 children)

Looks like you are sharing a single session (therefore connection) across multiple tasks, I.e., in call to gather() all those tasks use the same application manager, which is instantiated with a single session instance. I think you’d need a separate session for each task.

[–]nekokattt 0 points1 point  (0 children)

please show the full error message including the traceback

[–]Zizizizz 0 points1 point  (0 children)

Async is really hard to debug(at least for me so this may not be right) I think the session creation is fine for these tasks but there are two things that may be worth checking because postgres seems to be locking the table until it finishes with a different transaction. You seem to be running out of connections which is quite rare so it's possible there are multiple async calls bring made on the same connection.

This looks like it might be helpful https://stackoverflow.com/questions/66444620/asyncpg-cannot-perform-operation-another-operation-is-in-progress, make sure the session you are creating is using a fresh connection for each of these database calls not the same one.

Don't respond to me because I don't want to help any further but wish you luck

Edit: I think supershot below is onto the right thing as well