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

httpx.ConnectError: All connection attempts failed #872

Open
litagent opened this issue Jan 18, 2024 · 2 comments
Open

httpx.ConnectError: All connection attempts failed #872

litagent opened this issue Jan 18, 2024 · 2 comments

Comments

@litagent
Copy link

Bug description

This issue "httpx.ConnectError: All connection attempts failed", is occurring rarely, can't replicate it. Do not why this issue is coming.

How to reproduce

Expected behavior

Prisma information

Environment & setup

  • OS: debian
  • Database: postgreSQL
  • Python version: 3.11
  • Prisma version: 0.9.1

@ishaan-jaff
Copy link

+1 on this - we're seeing this too

@Xmaster6y
Copy link

On my side this is clearly happening when handling multiple queries in parallel.

For me, this happens in two different scenarios.

  • When handling multiple requests (my framework FastAPI, like any, will deal with them in parallel)
  • When I gather multiple queries using asyncio.gather

I am used to having only one global Prisma client, I think it's best practice, and thus I could solve this by implementing a rudimentary lock mechanism (lock, queue and callbacks).

Yet I am not satisfied and expected this kind of stuff to be handled natively, but the doc is quite brief so I might have missed stuff. Anyone has a workaround or optim using the codebase (like .batch_)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants