Queries do not return if there was a connection error
See original GitHub issueI don’t want my app to exit, if there’s an error in the db connection (so, users can be shown some 503 page). So, I listen on the connection error event, but I just log possible errors to the console.
Now, say db connect has failed, and a request comes in, the app queries the db (e.g. with <Model>.find
), but the callback isn’t even called. So, the request just times out at some point…
Issue Analytics
- State:
- Created 11 years ago
- Comments:9
Top Results From Across the Web
Connection Error after a few SQL Queries · Issue #135 - GitHub
i am receiving in my logs ConnectionError after a few scripts executions. but when i execute the SQL scripts one at a time...
Read more >Troubleshoot query time-out errors - SQL Server
This article describes how to troubleshoot the time-out errors when you run slow-running queries.
Read more >node.js mssql callback on connection error - Stack Overflow
return records as well as query and database connection errors. It returns records and query errors, but does not work for Connection errors...
Read more >Handling operation errors - Apollo GraphQL Docs
When a network error occurs, Apollo Client adds it to the error.networkError field returned by your useQuery call (or whichever operation hook you...
Read more >Common Errors When Using MySQL - O'Reilly
To remedy the problem, first check that your query is correct. Is it reasonable that it should return so many rows? If so,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I am encountering this issue… Is there a way to at least provide a timeout so that the query will fail / throw an error if the query takes too long?
For posterity’s sake, it looks like an option to disable command buffering was indeed added: https://mongoosejs.com/docs/guide.html#bufferCommands