Context:
I'm using Laravel + Octane + Spatie Multitenancy with a session-based tenant switcher in middleware. The middleware calls Tenant::makeCurrent() using a tenant ID stored in the session.
The Issue:
When the app exhausts PostgreSQL connections (e.g., due to many slow queries or transaction failures), the app/octane crashs and users sometimes begin to see data from another tenant/user after the database becomes available again.
This appears to be a tenant context leak — tenant state is being shared between requests.
I don't know if this is a multi-tenancy or octane related issue.
This is not a bug easy to catch localy.
Does anyone can help me?
Thank You