Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

504 gateway timeout error NodeJs

I have an application which is hosted in DC/OS instance, The application query the snowflake database and get the result. I am using snowflake sdk to to query the snowflake data base, we are also streaming the result we are getting from snowflake.

 var statement = connection.execute({
          sqlText: sql,
          complete: function (err, stmt, rows) {
    var stream = stmt.streamRows();
                  callback(err, stream, response);
}}

But if querying is large and the processing of query takes time in snowflake , I get 504 gateway timeout error at my client.although the node service is still running , but suppose I am hitting DC/OS from browser/postman I will get 504 timeout error here but snowflake returns result to my node service. What is the right strategy to avoid it ? this is the error which I am getting at my client from the server though my node service still maintains connection with snowflake and get the result from snowflake.

like image 579
user3649361 Avatar asked Nov 08 '22 14:11

user3649361


1 Answers

Can you check what your statement timeout is set to?

Can you try out the following :

https://docs.snowflake.com/en/sql-reference/sql/alter-user.html

# set timeout to 15 minutes
alter user USERNAME set STATEMENT_TIMEOUT_IN_SECONDS = 900;

https://docs.snowflake.com/en/sql-reference/sql/alter-session.html

STATEMENT_TIMEOUT_IN_SECONDS =

Examples Set the lock timeout for statements executed in the session to 1 hour (3600 seconds):

alter session set STATEMENT_TIMEOUT_IN_SECONDS = 3600;

Set the lock timeout for statements executed in the session back to the default:

alter session unset STATEMENT_TIMEOUT_IN_SECONDS;

Have you reached out to snowflake support?

like image 175
john.da.costa Avatar answered Nov 14 '22 20:11

john.da.costa