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

bug: When importing a taxonomy, the /projects API call stays pending during the /import background task running #401

Open
eric-nguyen-cs opened this issue Feb 13, 2024 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@eric-nguyen-cs
Copy link
Contributor

I believe this is due to FastAPI's (or even more likely Starlette's) implementation of an ASGI app: the background tasks are awaited before the body is completely sent (send({"type": "http.response.body", "body": b"", "more_body": False}) is awaited after the background tasks finish)
Thus, the /projects call is considering to be HTTP pipelining and is responded after the /import background tasks are finished

A temporary fix is to force the HTTP connection of /import to close

Further work should be done to diagnose this issue and report it to FastAPI or Starlette (with at least a small reproducible example of the issue and if possible a solution)

@eric-nguyen-cs eric-nguyen-cs added the 🐛 bug Something isn't working label Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
Development

No branches or pull requests

1 participant