Commit 315e315
committed
fix(models): add lazy='selectin' to User.identity to prevent MissingGreenlet
association_proxy fields (email, username, password_hash, email_verified,
primary_mobile) access User.identity at attribute-read time. In async
SQLAlchemy contexts this triggered a synchronous greenlet IO call, causing:
sqlalchemy.exc.MissingGreenlet: greenlet_spawn has not been called
Observed 63 occurrences in 10 minutes on production. Adding lazy='selectin'
makes SQLAlchemy eagerly load identity alongside every User query, eliminating
the lazy-load IO entirely and fixing the crash.
Ref: PR #258 (nap-liu)1 parent 212ccea commit 315e315
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
| |||
0 commit comments