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

Transaction handling is buggy - We need a middleware that opens and close transaction on each request. #121

Open
Tracked by #70
alexgarel opened this issue Nov 18, 2022 · 3 comments
Labels
🐛 bug Something isn't working 🎯 P0 performance

Comments

@alexgarel
Copy link
Member

What

Today, folksonomy was failing.

Log is as follow (for any request):

nov. 18 11:00:47 folksonomy uvicorn[324]: ERROR:    Exception in ASGI application
nov. 18 11:00:47 folksonomy uvicorn[324]: Traceback (most recent call last):
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     result = await app(self.scope, self.receive, self.send)
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     return await self.app(scope, receive, send)
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     await super().__call__(scope, receive, send)
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     await self.middleware_stack(scope, receive, send)
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     raise exc
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     await self.app(scope, receive, _send)
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     raise exc
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     await self.app(scope, receive, sender)
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     await route.handle(scope, receive, send)
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     await self.app(scope, receive, send)
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     response = await func(request)
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     raw_response = await run_endpoint_function(
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/.local/lib/python3.8/site-packages>
nov. 18 11:00:47 folksonomy uvicorn[324]:     return await dependant.call(**values)
nov. 18 11:00:47 folksonomy uvicorn[324]:   File "/home/folksonomy/folksonomy_api/./folksonomy/api.py>
nov. 18 11:00:47 folksonomy uvicorn[324]:     timing = await db_exec("""

Steps to reproduce the behavior:

I'm not sure how to reproduce, we should first trigger a hard failure, then all transaction would fail.

Expected behavior

Transaction should be isolated between requests.

The best would be a middleware that opens and close transaction on each request.

You can eventually look how it's done in taxonomy editor.

@alexgarel alexgarel added the 🐛 bug Something isn't working label Nov 18, 2022
@teolemon teolemon changed the title Transaction handling is buggy Transaction handling is buggy - We need a middleware that opens and close transaction on each request. Nov 29, 2022
@teolemon
Copy link
Member

Putting a P1 on this @alexgarel , feel free to increase or reduce

@alexgarel
Copy link
Member Author

today folksonomy was off again due to this very same error.

@teolemon teolemon added 🎯 P0 and removed 🎯 P1 Priority 1 labels Nov 15, 2023
@teolemon
Copy link
Member

bumping to P0 as a result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🎯 P0 performance
Projects
Status: No status
Development

No branches or pull requests

2 participants