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.

Implement `debugPanic` like functionality for `getConfig` and `getDmmf` of Query Engine

See original GitHub issue

To be able to implement and test Prisma’s CLI engine crash reporting for getConfig and getDmmf, we need new functionality similar to debugPanic of Migration and Introspection Engines (https://prisma.github.io/prisma-engines/doc/migration_core/json_rpc/index.html#-debugpanic) that we can somehow trigger when we execute getConfig or getDmmf.

For getConfig we call in the CLI:

  • For the Node-API library NodeAPIQueryEngineLibrary.getConfig(...)
  • For the Binary ...engineArgs, 'cli', 'get-config', ...args

For getDmmf we call in the CLI:

  • For the Node-API library NodeAPIQueryEngineLibrary.dmmf(datamodel)
  • For the Binary '--enable-raw-queries', 'cli', 'dmmf'

For all 4 we have 2 different options how to implement this:

  1. We implement a separate function/endpoint debugPanic that we can call instead of the intended function/endpoint, and when we want to test the error reporting we would just call out to that instead of the actual one.
  2. We use the existing function/endpoint but add a way to configure what happens inside (and then trigger the panic there). For Node-API library that could maybe be an environment variable, and for the Binary an additional parameter.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
janpiocommented, Apr 14, 2022

That sounds good. @jkomyno who will use these, just needs to know how to trigger each.

What you describe for Node-API could be related to these issues (and the comments): https://github.com/prisma/prisma/issues/7810 + https://github.com/prisma/prisma/issues/11362

1reaction
dpetrickcommented, Apr 14, 2022

The binary already has a way of triggering errors: Fatal or non-fatal, based on included headers x-debug-non-fatal or x-debug-fatal. Fatal = engine exists, non-fatal: panic is thrown. That’s only possible on the graphql endpoint right now, but not really a problem to expand that to other ones too.

The NodeAPI already has a debug_panic endpoint that simply errors.

Edit: The NodeAPI basically returns a user-facing error, not really panics. We could change that to a true panic, but then the assumption is that there are cases where the panic hooks are not working. The NodeAPI should always hook panics with the handler, but that requires some more investigation.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Prisma 3.14.0 Release - GitClear
ci(update-engines-version): Output Prisma-Engines commit hash with ... Implement debugPanic like functionality for getConfig and getDmmf of ...
Read more >
Query engine (Concepts) - Prisma
The query engine receives the SQL response from the database; The query engine returns the result as plain old JavaScript objects to Prisma...
Read more >
Amazon Athena announces upgraded query engine
Amazon Athena has upgraded its SQL query engine to include the latest features from the Trino open source project. Athena engine version 3 ......
Read more >
What is a query engine? | Learn - Alluxio
A distributed SQL query engine will allow you to query data from a variety of data sources like Hadoop, AWS S3, NoSQL, MySQL,...
Read more >
Presto: Free, Open-Source SQL Query Engine for any Data
PrestoDB lets you run interactive/ad-hoc SQL queries at sub-second performance. Query data lakes, lakehouses, or databases. Runs reliably at massive scale.
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