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

SNOW-559970: Client Panic when context canceled error received #562

Closed
satishbhor opened this issue Mar 15, 2022 · 3 comments
Closed

SNOW-559970: Client Panic when context canceled error received #562

satishbhor opened this issue Mar 15, 2022 · 3 comments
Assignees
Labels
bug Erroneous or unexpected behaviour

Comments

@satishbhor
Copy link

This issue occurs when you try to monitor async query by passing cancelable context to WithFetchResultByID
e.g.

ctx, cancel := context.WithCancel(context.Background())
sfCtx := sf.WithFetchResultByID(ctx, qid)
r,e := db.QueryWithContext(sfCtx, "")
cancel()

This is happening due to unchecked casting to SnowflakeError

ERRO[0108]monitoring.go:145 gosnowflake.(*snowflakeConn).checkQueryStatus failed to get response. err: context canceled 
2022/03/15 13:24:40 Done loading internal Cookies JOB20220315132436515
panic: interface conversion: error is *errors.errorString, not *gosnowflake.SnowflakeError

goroutine 309 [running]:
github.com/snowflakedb/gosnowflake.(*snowflakeConn).QueryContext(0xc000aa8300, 0x1b12600, 0xc00096ea50, 0x0, 0x0, 0x242c698, 0x0, 0x0, 0x17b71a0, 0x7fbed4290d28, ...)
        /opt/go_modules/pkg/mod/github.com/snowflakedb/gosnowflake@v1.6.7/connection.go:315 +0x269
database/sql.ctxDriverQuery(0x1b12600, 0xc00096ea50, 0x7fbed4076f18, 0xc000aa8300, 0x0, 0x0, 0x0, 0x0, 0x242c698, 0x0, ...)
        /opt/softwares/go/src/database/sql/ctxutil.go:48 +0x227
database/sql.(*DB).queryDC.func1()
        /opt/softwares/go/src/database/sql/sql.go:1643 +0x1de
database/sql.withLock(0x1afe100, 0xc0001d0a20, 0xc0001b9b40)
        /opt/softwares/go/src/database/sql/sql.go:3284 +0x69
database/sql.(*DB).queryDC(0xc0002e60d0, 0x1b12600, 0xc00096ea50, 0x0, 0x0, 0xc0001d0a20, 0xc000987970, 0x0, 0x0, 0x0, ...)
        /opt/softwares/go/src/database/sql/sql.go:1638 +0x5f4
database/sql.(*DB).query(0xc0002e60d0, 0x1b12600, 0xc00096ea50, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x0, ...)
        /opt/softwares/go/src/database/sql/sql.go:1621 +0x136
database/sql.(*DB).QueryContext(0xc0002e60d0, 0x1b12600, 0xc00096ea50, 0x0, 0x0, 0x0, 0x0, 0x0, 0xc0007e8400, 0x0, ...)
        /opt/softwares/go/src/database/sql/sql.go:1598 +0xd1
@github-actions github-actions bot changed the title Client Panic when context canceled error received SNOW-559970: Client Panic when context canceled error received Mar 15, 2022
@github-actions github-actions bot closed this as completed Jul 1, 2022
@sfc-gh-jfan sfc-gh-jfan reopened this Jul 1, 2022
@github-actions github-actions bot closed this as completed Jul 2, 2022
@sfc-gh-jfan sfc-gh-jfan reopened this Jul 6, 2022
@sfc-gh-dszmolka sfc-gh-dszmolka self-assigned this Mar 28, 2023
@sfc-gh-dszmolka sfc-gh-dszmolka added the status-triage Issue is under initial triage label Mar 28, 2023
@sfc-gh-dszmolka
Copy link
Contributor

thank you for raising this issue with us ! I see the relevant code part is essentially still the same in today's latest version (v1.6.19) as it was in the connector's version when you raised this issue (v.1.6.7).
we're gonna take a look to see how this could be best addressed. thank you for bearing with us !

@sfc-gh-dszmolka sfc-gh-dszmolka added status-in_progress Issue is worked on by the driver team and removed status-triage Issue is under initial triage labels Mar 28, 2023
@sfc-gh-igarish sfc-gh-igarish added the bug Erroneous or unexpected behaviour label Mar 30, 2023
@sfc-gh-dszmolka
Copy link
Contributor

fixed with #771

@sfc-gh-dszmolka sfc-gh-dszmolka added status-pr_pending_merge A PR is made and is under review status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. and removed status-in_progress Issue is worked on by the driver team status-pr_pending_merge A PR is made and is under review labels Apr 12, 2023
@sfc-gh-dszmolka sfc-gh-dszmolka removed the status-fixed_awaiting_release The issue has been fixed, its PR merged, and now awaiting the next release cycle of the connector. label Apr 19, 2023
@sfc-gh-dszmolka
Copy link
Contributor

fix released with 1.6.20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Erroneous or unexpected behaviour
Projects
None yet
Development

No branches or pull requests

4 participants