Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Queries that run for over 45 seconds fail with no error #795

Closed
madisonchamberlain opened this issue May 16, 2023 · 3 comments
Closed

Queries that run for over 45 seconds fail with no error #795

madisonchamberlain opened this issue May 16, 2023 · 3 comments
Assignees
Labels
bug Erroneous or unexpected behaviour duplicate

Comments

@madisonchamberlain
Copy link
Contributor

I found that running queries which take longer than 45 seconds return with no result and no error. The endpoint I am using when I experience this is rowsForRunningQuery. Based on the name of this API, I would expect to be able to submit a query in async mode, and then call this API to wait for it to return. The function, getQueryResultResp just waits 45 seconds, but since I am using it through QueryContext I would expect this to be blocking. When this happens nothing returns. The response from FuncGet indicates the status of the query, and I am wondering, why not pull until the query is no longer running? (see `ErrQueryIsRunning = 279301 from errors.go:240)

If you are interested in reproducing this is what I am doing:

ctx = gosnowflake.WithAsyncMode(gosnowflake.WithAsyncModeNoFetch(ctx))
ctx = gosnowflake.WithFetchResultByID(ctx, snowflakeQueryIdFromOriginalSubmit)

// schedule the execution of the query in async mode
asyncResult, err := conn.QueryContext(ctx, "")
if err == nil && asyncResult != nil {
	if asyncResult.Inner() != nil {
		if snowflakeResult, ok := asyncResult.Inner().(gosnowflake.SnowflakeResult); ok {
			if snowflakeResult == nil {
				do something
				}
			}
		}

		// calling Close() here will block until either the query completes or the ctx expires. If the context expires
		// we rely on the snowflake driver async impl to also cancel the running query
		err = asyncResult.Close()
	}


Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of GO driver are you using?
    Latest (1.6.20)

  2. What operating system and processor architecture are you using?
    Mac M1

  3. What version of GO are you using?
    run go version in your console
    1.20

4.Server version:* E.g. 1.90.1
You may get the server version by running a query:

SELECT CURRENT_VERSION();
  1. What did you do?

    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.

  2. What did you expect to see?

    What should have happened and what happened instead?

  3. Can you set logging to DEBUG and collect the logs?

    https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors

  4. What is your Snowflake account identifier, if any? (Optional)

@madisonchamberlain madisonchamberlain added the bug Erroneous or unexpected behaviour label May 16, 2023
@sfc-gh-dszmolka
Copy link
Contributor

hi and thank you for submitting this issue ! we're already investigating something similar (async query returns with absolutely no result) on #768

however it is possible your issue is different - can you please take a look at and see if it's relevant for you too ? looks relevant to me.

@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this May 23, 2023
@sfc-gh-dszmolka sfc-gh-dszmolka added status-triage Issue is under initial triage status-information_needed Additional information is required from the reporter labels May 23, 2023
@madisonchamberlain
Copy link
Contributor Author

hi and thank you for submitting this issue ! we're already investigating something similar (async query returns with absolutely no result) on #768

however it is possible your issue is different - can you please take a look at and see if it's relevant for you too ? looks relevant to me.

Hi there, yeah it looks the same to me. We have a forked version of the driver with the same patch

@sfc-gh-dszmolka
Copy link
Contributor

thank you for confirming! in this case, closing this as a duplicate of #768 to focus efforts on that one.

@sfc-gh-dszmolka sfc-gh-dszmolka closed this as not planned Won't fix, can't repro, duplicate, stale May 24, 2023
@sfc-gh-dszmolka sfc-gh-dszmolka added duplicate and removed status-triage Issue is under initial triage status-information_needed Additional information is required from the reporter labels May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Erroneous or unexpected behaviour duplicate
Projects
None yet
Development

No branches or pull requests

2 participants