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

Attached to a different loop error when running server from CLI #90

Closed
frankie567 opened this issue Oct 5, 2022 Discussed in #89 · 1 comment
Closed

Attached to a different loop error when running server from CLI #90

frankie567 opened this issue Oct 5, 2022 Discussed in #89 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@frankie567
Copy link
Member

Discussed in https://github.com/orgs/fief-dev/discussions/89

It appears that the recent changes in the CLI to automatically create main workspace and user provokes issues with asyncpg (and probably aiomysql).

The problem is that before running uvicorn, we are running functions to create main workspace and user, which open connections to the DB.

After that, when Uvicorn runs, it setups a new event loop ; but the database connections objects are still the same and thus provokes errors.

This is due to our lack of isolation of our main engine and workspace engine manager.

@frankie567 frankie567 added the bug Something isn't working label Oct 5, 2022
@frankie567 frankie567 self-assigned this Oct 5, 2022
@frankie567
Copy link
Member Author

Fixed is currently implemented and make sure we don't break isolation for DB connections.

frankie567 added a commit that referenced this issue Oct 5, 2022
Bug fixes
---------

* Fix #90: improve DB connections isolation to avoid issues when running server from CLI. Thanks @gooseman1721 for raising this 🙏
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
None yet
Development

No branches or pull requests

1 participant