question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Right now users need to explicitly call await prisma.disconnect() at the end of their program otherwise the running Node process won’t terminate.

Ideally the Prisma Client (or more correctly: the used Prisma Query Engine) should automatically disconnect when the Node process is trying to terminate. This removes a lot of friction points and simplifies the usage of Prisma Client - especially when getting started - since users don’t need to call await prisma.disconnect() explicitly anymore.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:20
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

5reactions
timsuchanekcommented, Apr 8, 2020

The assumption was, that if we start the Prisma process as a detached child process, Node.js still could properly exit, once the event loop is empty.

However, the problem is, that we still need to keep a stream to the process’ stderr and stdout open. These streams will still prevent the Node.js process from exiting.

We can revisit this topic once we have replaced the HTTP server with Neon bindings, as that will fundamentally change the interaction between Node.js and Rust for Prisma Client.

Issue for Neon Bindings: https://github.com/prisma/prisma/issues/767

2reactions
pantharshit00commented, Mar 26, 2021

@meotimdihia This will be soon resolved via https://github.com/prisma/prisma/issues/4911 as then node can directly call rust function instead of spawning a binary process. It is close to completion and being released in preview so stay tuned.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The amount of idle time required before suspending a session ...
Registry Hive: HKEY_LOCAL_MACHINE Registry Path: \System\CurrentControlSet\Services\LanManServer\Parameters\ Value Name: AutoDisconnect
Read more >
Mapped drive is disconnected - Windows Client
Type autodisconnect, and then press ENTER. On the Edit menu, click Modify. Click Hexadecimal. In the Value data box, type ffffffff, and ...
Read more >
How do I configure LAN autodisconnect? - ITPro Today
Start the registry editor (regedit.exe) · Move to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters · Double click autodisconnect · Set ...
Read more >
Network Drives Disconnect
Type autodisconnect, and then press ENTER. On the Edit menu, click Modify. Click Decimal. In the Value data box, type 0, and then...
Read more >
autoDisconnect - IBM
The autoDisconnect property allows a DataBlox to disconnect from the data source automatically when the application no longer requires a connection, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found