Open dynamikus opened 1 year ago
hello and thank you for submitting this issue. it is quite astonishing to me, because looking at the git blame, this code part has been there forever (but at least since it was originally uploaded to Github, 5 years ago).
of course it doesn't mean it has to be like this going forward, so we're going to take a look how the row stream could be reimplemented to play better along with the eventloop.
Yeah same here, I have been using this sdk for 4+ years now, and never come across a scenario to process something else while waiting for the data to load till last week.
Anyway thank you for looking into this, let me know if you want a code example to replicate it.
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.0What are the component versions in the environment (
npm list
)?5.Server version:* E.g. 1.90.1 7.24.2
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.