Too large queries cause process to crash instead of throwing an error #5812
Labels
underlying library issue
This issue is a bug with an underlying library, like the MongoDB driver or mongodb-core
Milestone
When sending a malformed query I expect an exception to be thrown. Instead node crashes with a stack trace that does not allow to debug the issue
This example code reproduces the problem
The output:
I expected the output to be:
Note: I understand that the query size is limited and when it is exceeded the query will fail.
However I expect to fail with an error in the Promise thread that caused this.
What happens is that Node crashes in a separate execution thread and I could find no way to figure out what query causes this error.
In my specific scenario an express server was querying one collection to get a list of Ids then using a second collection to look up all the matching documents.
When a user would use a filter condition that would match too many ids the system would simply crash because the resulting query is too large.
The text was updated successfully, but these errors were encountered: