SNOW-874803: stream rows api blocks the event loop #593
Labels
enhancement
The issue is a request for improvement or a new feature
status-triage_done
Initial triage done, will be further handled by the driver team
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
What version of NodeJS driver are you using?
1.6.23
What operating system and processor architecture are you using?
Windows
What version of NodeJS are you using?
(
node --version
andnpm --version
)20.2.0
What are the component versions in the environment (
npm list
)?5.Server version:* E.g. 1.90.1
7.24.2
6. What did you do?
I am using the stream rows api, to stream the results back. I have a modest data set of 100K. While data is getting downloaded no other process in the event loop is getting processed. I would assume the culprit is[ process.nextTick()] (https://github.com/snowflakedb/snowflake-connector-nodejs/blob/master/lib/connection/result/row_stream.js#L174) or something related to that.
This is because process.nextTick() is not technically part of the event loop. Instead, the nextTickQueue will be processed after the current operation is completed, regardless of the current phase of the event loop. Basically, any other task that is part of the event loop will get deferred till Snowflake is done getting the data.
I expect streaming data should be a non-blocking event, so it can give a chance to other processes in the event loop to run.
The text was updated successfully, but these errors were encountered: