tediousjs / node-mssql

Microsoft SQL Server client for Node.js
https://tediousjs.github.io/node-mssql
MIT License
2.22k stars 464 forks source link

queries of over several hours on the db side #1556

Closed DanielSegal1 closed 10 months ago

DanielSegal1 commented 10 months ago

Recently, when checking logs of our MSSQL db I saw there are queries which being run for over several hours (up to 8 hours), while my node-mssql is configured with requestTimeout: 30000. I came to the idea that maybe the timeout is only on the application side, and not really aborting the query on the db.

I tried finding explanation online but couldn't.

so I came here to

Thanks!

dhensby commented 10 months ago

Please use the issue template.

I'm not sure how your system could be accepting queries for 8 hours if you have a request timeout. Under the hood that will be managed by the driver and not this library.

Are you sure they are queries lasting that long (what are they doing?!) and not just open connections? The pool has properties you can monitor (like number of connections in use) and that will tell you if there are any connections that have been released (and potentially not being returned to the pool).

Without any example code, replication instructions, version of the library, etc I can't provide any further guidance.