Nodejs mssql timeout error when executing long stored procedure

1.6k Views Asked by At

I have a code that executes SQL stored procedure that takes about 45sec to run. Everything works as expected. All SQL transactions are posted etc, however I get an error on a server side:

{ RequestError: Failed to cancel request in 5000ms
at Request.tds.Request.err [as userCallback] (G:\CCIBE_DEV\ccibe\node_modules\mssql\lib\tedious\request.js:775:19)
at Request.callback (G:\CCIBE_DEV\ccibe\node_modules\mssql\node_modules\tedious\lib\request.js:56:14)
at Connection.socketError (G:\CCIBE_DEV\ccibe\node_modules\mssql\node_modules\tedious\lib\connection.js:2421:20)
at Connection.dispatchEvent (G:\CCIBE_DEV\ccibe\node_modules\mssql\node_modules\tedious\lib\connection.js:1279:15)
at Connection.cancelTimeout (G:\CCIBE_DEV\ccibe\node_modules\mssql\node_modules\tedious\lib\connection.js:1203:10)
at Timeout.cancelTimer.setTimeout [as _onTimeout] (G:\CCIBE_DEV\ccibe\node_modules\mssql\node_modules\tedious\lib\connection.js:1167:14)
at ontimeout (timers.js:498:11)
at tryOnTimeout (timers.js:323:5)
at Timer.listOnTimeout (timers.js:290:5)
code: 'ETIMEOUT',

It is my understandings that there is a default timeout in mssql module of 15sec and then cancel request is originated. I would like to know if there is way around it.

0

There are 0 best solutions below