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

Emit an error event when the database connection is interrupted #2218

Closed
queicherius opened this issue Apr 17, 2020 · 2 comments
Closed

Emit an error event when the database connection is interrupted #2218

queicherius opened this issue Apr 17, 2020 · 2 comments
Assignees
Labels
kind/improvement An improvement to existing feature and code. tech/typescript Issue for tech TypeScript. topic: prisma-client
Milestone

Comments

@queicherius
Copy link

Bug description

Right now, when a live database connection is interrupted (e.g. the database is shut down), Prisma (Client) does not emit any events, or I can't find a way of getting an event.

How to reproduce

  • Connect with the client
  • Shutdown the database

Expected behavior

I want an event immediately when a connection fails, so I can kill the process (since in my environment often time it's just a network issue and restarting works).

Instead, it waits until the next database command comes in, then errors that one, but still doesn't emit any events

Environment & setup

  • OS: Ubuntu
  • Database: PostgreSQL
  • Prisma version:
@prisma/cli          : 2.0.0-beta.2
Current platform     : debian-openssl-1.1.x
Query Engine         : query-engine 76857c35ba1e1764dd5473656ecbbb2f739e1822 (at /projects/nest-graphql/node_modules/@prisma/cli/query-engine-debian-openssl-1.1.x)
Migration Engine     : migration-engine-cli 76857c35ba1e1764dd5473656ecbbb2f739e1822 (at /projects/nest-graphql/node_modules/@prisma/cli/migration-engine-debian-openssl-1.1.x)
Introspection Engine : introspection-core 76857c35ba1e1764dd5473656ecbbb2f739e1822 (at /projects/nest-graphql/node_modules/@prisma/cli/introspection-engine-debian-openssl-1.1.x
  • Node.js version: v13.9.0
@queicherius
Copy link
Author

Also on a side-note prisma.connect() does not actually initiate a database connection. I dont get an error when I call it and no DB is running. Instead I have to run prisma.raw() with a simple select.

@Sytten
Copy link
Contributor

Sytten commented Apr 17, 2020

This could be combined with #2100 (comment)

@pantharshit00 pantharshit00 added kind/improvement An improvement to existing feature and code. topic: prisma-client labels Apr 18, 2020
@janpio janpio added this to the Beta 4 milestone Apr 21, 2020
@janpio janpio added tech/typescript Issue for tech TypeScript. and removed team/product labels Apr 30, 2020
@timsuchanek timsuchanek self-assigned this May 4, 2020
@divyenduz divyenduz modified the milestones: Beta 4, Beta 5 May 4, 2020
@janpio janpio modified the milestones: Beta 5, Beta 6 May 12, 2020
@janpio janpio modified the milestones: Beta 6, Beta 7, Beta 8 May 26, 2020
@janpio janpio modified the milestones: Beta 9, New Beta 9 Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement An improvement to existing feature and code. tech/typescript Issue for tech TypeScript. topic: prisma-client
Projects
None yet
Development

No branches or pull requests

6 participants