Skip to content
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

Using gather inside transaction may leads to errors #260

Open
kalombos opened this issue Jun 28, 2024 · 4 comments
Open

Using gather inside transaction may leads to errors #260

kalombos opened this issue Jun 28, 2024 · 4 comments

Comments

@kalombos
Copy link
Collaborator

async with db.aio_atomic():
    await asyncio.gather(t1(), t2(), t3())

It seems fine if all tasks inside gather have no transaction but if t1 and t2 have aio_atomic statement inside it leads to mess of savepoints and errors.

@spumer
Copy link

spumer commented Jun 28, 2024

It seems fine if all tasks inside gather have no transaction

any exception in SQL STATEMENT will interrupt outer transaction and cause errors in other tasks too

@kalombos
Copy link
Collaborator Author

kalombos commented Jul 1, 2024

That's right. Thank you @spumer

@kalombos
Copy link
Collaborator Author

kalombos commented Jul 1, 2024

That's right. Thank you @spumer. As you said the solution is to add kind of forbid_subtask param to aio_atomic which forbids using of aio_atomic in subtasks.

@kalombos
Copy link
Collaborator Author

kalombos commented Jul 1, 2024

related #215 #123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants