Git Product home page Git Product logo

Comments (7)

rohantandon avatar rohantandon commented on August 15, 2024 1

Just to get clarification: Does this behavior occur if you use a tx.PrepareContext? Looking at integrating Snowflake access for relatively async processes sharing the singular db instance as well.

I have not tested with PrepareContext - if further down the call stack populateSessionParameters or connectionTelemetry is called, my guess is that it's possible for this to happen.

from gosnowflake.

gabizou avatar gabizou commented on August 15, 2024 1

I've not personally ran into it with PrepareContext in production, but I can say that threading through the codepath, it will hit the same connectionTelemetry function call. Though, something to note is when errors crop up between goroutines (I've forced a creation of multiple goroutines and therefor multiple sql.Conn to pool which has some interesting behaviors):

test code with concurrent goroutines
func TestSnowflakeConcurrentReads(t *testing.T) {
	// set up config with values
	connector := sf.NewConnector(sf.SnowflakeDriver{}, *c)
	db := sql.OpenDB(connector)
	if err := db.Ping(); err != nil {
		t.Fatal(err)
	}
	// this is where we can set our database
	db.Query("USE DATABASE EXAMPLE_DATABASE")
	wg := sync.WaitGroup{}
	for i := 0; i < 10; i++ {
		wg.Add(1)
		go func() {
			for c := 0; c < 10; c++ {
				fmt.Printf("goroutine[%d(%d)] calling prepare\n", i, c)
				stmt, err := db.PrepareContext(context.Background(), "SELECT * FROM information_schema.columns WHERE table_schema = ?")
				if err != nil {
					t.Error(err)
				}
				rows, err := stmt.Query("INFORMATION_SCHEMA")
				if err != nil {
					t.Error(err)
				}
				if rows == nil {
					continue
				}
				for rows.Next() {
					fmt.Printf("%d: %v", i, rows.Err())
				}
				_ = rows.Close()
			}
			wg.Done()
		}()
	}
	wg.Wait()
}

After running this (with the added logging), you'll get these sort of errors:

log output of said test

goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(1)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(2)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(1)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(3)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(2)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(4)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(1)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(1)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(1)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(1)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(1)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(5)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(3)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(1)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(2)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(2)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(2)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(2)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(2)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(4)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(6)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(2)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(3)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(3)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(3)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(3)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(3)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(5)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(7)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(3)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(4)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(4)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(4)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(4)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(6)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(4)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(8)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(4)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(5)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(5)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(5)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(5)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(7)] calling prepare
time="2023-01-18T16:28:41-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(5)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(6)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(5)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(9)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(6)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(6)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(8)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(6)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(6)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(7)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(6)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(7)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(7)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(7)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(9)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(1)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(7)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(1)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(8)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(7)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(8)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(8)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(8)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(2)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(8)] calling prepare
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(2)] calling prepare
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(9)] calling prepare
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(8)] calling prepare
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(9)] calling prepare
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(9)] calling prepare
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(9)] calling prepare
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(3)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(9)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(3)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(4)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(5)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(6)] calling prepare
time="2023-01-18T16:28:42-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(7)] calling prepare
time="2023-01-18T16:28:43-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(8)] calling prepare
time="2023-01-18T16:28:43-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(9)] calling prepare
time="2023-01-18T16:28:43-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
time="2023-01-18T16:28:45-08:00" level=error msg="error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name." func="gosnowflake.(*snowflakeConn).queryContextInternal" file="connection.go:318"
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(4)] calling prepare

Investigating further as to why these errors show up (when I did try to see if I could trigger a panic with prepared context), I tried to use the debugger to find the source of the errors, which lead to a panic:

debugger triggering a panic for concurrent writes with telemetry

GOROOT=/Users/gabizou/go/go1.18 #gosetup
GOPATH=/Users/gabizou/go #gosetup
/Users/gabizou/go/go1.18/bin/go test -c -tags integration_snowflake_test -o /private/var/folders/1x/_12tcfv12rvc9qtzv9z40dxw0000gn/T/GoLand/___1TestSnowflakeConcurrentReads_in_project.test -gcflags all=-N -l project #gosetup
/Users/gabizou/go/go1.18/bin/go tool test2json -t /private/var/folders/1x/_12tcfv12rvc9qtzv9z40dxw0000gn/T/dlvLauncher.sh /Users/gabizou/Library/Application Support/JetBrains/Toolbox/apps/Goland/ch-0/223.8214.59/GoLand.app/Contents/plugins/go-plugin/lib/dlv/macarm/dlv --listen=127.0.0.1:61168 --headless=true --api-version=2 --check-go-version=false --only-same-user=false exec /private/var/folders/1x/_12tcfv12rvc9qtzv9z40dxw0000gn/T/GoLand/___1TestSnowflakeConcurrentReads_in_project.test -- -test.v -test.paniconexit0 -test.run ^\QTestSnowflakeConcurrentReads\E$
=== RUN   TestSnowflakeConcurrentReads
2023/01/18 16:35:55 flag=config val=
2023/01/18 16:35:55 flag=test.coverprofile val=
2023/01/18 16:35:55 flag=test.paniconexit0 val=false
2023/01/18 16:35:55 flag=test.run val=^\QTestSnowflakeConcurrentReads\E$
2023/01/18 16:35:55 flag=test.testlogfile val=
2023/01/18 16:35:55 flag=test.timeout val=
2023/01/18 16:35:55 flag=test.v val=-test.paniconexit0
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
goroutine[10(0)] calling prepare
ERRO[0225]connection.go:318 gosnowflake.(*snowflakeConn).queryContextInternal error: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name. 
    snowflake_integration_test.go:49: 090105 (22000): Cannot perform SELECT. This session does not have a current database. Call 'USE DATABASE', or use a qualified name.
goroutine[10(1)] calling prepare
fatal error: concurrent map writes

goroutine 67 [running]:
runtime.throw({0x104f81704?, 0x12?})
	/Users/gabizou/go/go1.18/src/runtime/panic.go:992 +0x50 fp=0x140005da870 sp=0x140005da840 pc=0x104669590
runtime.mapassign_faststr(0x140005241e0?, 0x12?, {0x14000802198, 0x12})
	/Users/gabizou/go/go1.18/src/runtime/map_faststr.go:212 +0x3fc fp=0x140005da8e0 sp=0x140005da870 pc=0x104645c5c
github.com/snowflakedb/gosnowflake.(*snowflakeConn).populateSessionParameters(0x140001c8a80, {0x140000f2000, 0x22, 0x2a})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connection_util.go:169 +0x6e4 fp=0x140005daa70 sp=0x140005da8e0 pc=0x104edcc84
github.com/snowflakedb/gosnowflake.authenticateWithConfig(0x140001c8a80)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:528 +0x734 fp=0x140005dad20 sp=0x140005daa70 pc=0x104ec1f84
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, ...}, ...})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/driver.go:40 +0x1a0 fp=0x140005daf70 sp=0x140005dad20 pc=0x104eeb980
github.com/snowflakedb/gosnowflake.(*SnowflakeDriver).OpenWithConfig(_, {_, _}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, ...}, ...})
	<autogenerated>:1 +0x84 fp=0x140005db1a0 sp=0x140005daf70 pc=0x104f2d894
github.com/snowflakedb/gosnowflake.Connector.Connect({{0x1051dadf8, 0x10564efa0}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, 0x0}, ...}}, ...)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connector.go:34 +0xdc fp=0x140005db590 sp=0x140005db1a0 pc=0x104ede11c
github.com/snowflakedb/gosnowflake.(*Connector).Connect(0x140001356c0, {0x1051dcd08, 0x14000036160})
	<autogenerated>:1 +0xa0 fp=0x140005db980 sp=0x140005db590 pc=0x104f2ed60
database/sql.(*DB).conn(0x14000206820, {0x1051dcd08, 0x14000036160}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1395 +0x994 fp=0x140005dbc40 sp=0x140005db980 pc=0x104bf79a4
database/sql.(*DB).prepare(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1588 +0x58 fp=0x140005dbd20 sp=0x140005dbc40 pc=0x104bf8a38
database/sql.(*DB).PrepareContext(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1557 +0x80 fp=0x140005dbdd0 sp=0x140005dbd20 pc=0x104bf87d0
project/snowflake_testTestSnowflakeConcurrentReads.func1()
	/Users/gabizou/code/go/project/snowflake_integration_test.go:43 +0x170 fp=0x140005dbfd0 sp=0x140005dbdd0 pc=0x104f6bc90
runtime.goexit()
	/Users/gabizou/go/go1.18/src/runtime/asm_arm64.s:1259 +0x4 fp=0x140005dbfd0 sp=0x140005dbfd0 pc=0x10469c194
created by project/snowflake_testTestSnowflakeConcurrentReads
	/Users/gabizou/code/go/project/snowflake_integration_test.go:40 +0x548

goroutine 1 [chan receive, 4 minutes]:
testing.(*T).Run(0x140000ba340, {0x104f8790e, 0x1c}, 0x1051d06f0)
	/Users/gabizou/go/go1.18/src/testing/testing.go:1487 +0x568
testing.runTests.func1(0x140000ba1a0)
	/Users/gabizou/go/go1.18/src/testing/testing.go:1839 +0xa8
testing.tRunner(0x140000ba1a0, 0x140001259d8)
	/Users/gabizou/go/go1.18/src/testing/testing.go:1439 +0x178
testing.runTests(0x14000451458, {0x10560f8c0, 0x2, 0x2}, {0x0, 0x0, 0x0})
	/Users/gabizou/go/go1.18/src/testing/testing.go:1837 +0x414
testing.(*M).Run(0x140002f81e0)
	/Users/gabizou/go/go1.18/src/testing/testing.go:1719 +0x954
main.main()
	_testmain.go:51 +0x8c

goroutine 22 [semacquire, 4 minutes]:
sync.runtime_Semacquire(0x1400051a540?)
	/Users/gabizou/go/go1.18/src/runtime/sema.go:56 +0x2c
sync.(*WaitGroup).Wait(0x1400051a540)
	/Users/gabizou/go/go1.18/src/sync/waitgroup.go:136 +0xf0
project/snowflake_testTestSnowflakeConcurrentReads(0x140000ba340)
	/Users/gabizou/code/go/project/snowflake_integration_test.go:62 +0x56c
testing.tRunner(0x140000ba340, 0x1051d06f0)
	/Users/gabizou/go/go1.18/src/testing/testing.go:1439 +0x178
created by testing.(*T).Run
	/Users/gabizou/go/go1.18/src/testing/testing.go:1486 +0x548

goroutine 23 [select, 4 minutes]:
database/sql.(*DB).connectionOpener(0x14000206820, {0x1051dccd0, 0x140002cc540})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1226 +0x9c
created by database/sql.OpenDB
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:794 +0x284

goroutine 26 [runnable]:
crypto/aes.sliceForAppend({0x14000283005, 0x0, 0x15e0}, 0x563)
	/Users/gabizou/go/go1.18/src/crypto/aes/aes_gcm.go:85 +0x1cc
crypto/aes.(*gcmAsm).Open(0x14000346000, {0x14000283005, 0x0, 0x15e0}, {0x140002db560, 0xc, 0xc}, {0x14000283005, 0x563, 0x15e0}, ...)
	/Users/gabizou/go/go1.18/src/crypto/aes/aes_gcm.go:176 +0x40c
crypto/tls.(*xorNonceAEAD).Open(0x140002db560, {0x14000283005, 0x0, 0x15e0}, {0x14000200f98, 0x8, 0x8}, {0x14000283005, 0x573, 0x15e0}, ...)
	/Users/gabizou/go/go1.18/src/crypto/tls/cipher_suites.go:497 +0x188
crypto/tls.(*halfConn).decrypt(0x14000200f58, {0x14000283000, 0x578, 0x15e5})
	/Users/gabizou/go/go1.18/src/crypto/tls/conn.go:373 +0x67c
crypto/tls.(*Conn).readRecordOrCCS(0x14000200e00, 0x0)
	/Users/gabizou/go/go1.18/src/crypto/tls/conn.go:667 +0xae0
crypto/tls.(*Conn).readRecord(0x14000200e00)
	/Users/gabizou/go/go1.18/src/crypto/tls/conn.go:581 +0x30
crypto/tls.(*Conn).Read(0x14000200e00, {0x1400034a000, 0x1000, 0x1000})
	/Users/gabizou/go/go1.18/src/crypto/tls/conn.go:1284 +0x174
net/http.(*persistConn).Read(0x140005265a0, {0x1400034a000, 0x1000, 0x1000})
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1929 +0x188
bufio.(*Reader).fill(0x140002eac60)
	/Users/gabizou/go/go1.18/src/bufio/bufio.go:106 +0x234
bufio.(*Reader).Peek(0x140002eac60, 0x1)
	/Users/gabizou/go/go1.18/src/bufio/bufio.go:144 +0x150
net/http.(*persistConn).readLoop(0x140005265a0)
	/Users/gabizou/go/go1.18/src/net/http/transport.go:2093 +0x1f0
created by net/http.(*Transport).dialConn
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1750 +0x1fa0

goroutine 27 [select]:
net/http.(*persistConn).writeLoop(0x140005265a0)
	/Users/gabizou/go/go1.18/src/net/http/transport.go:2392 +0x104
created by net/http.(*Transport).dialConn
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1751 +0x2000

goroutine 9 [runnable]:
sync.(*Mutex).Unlock(0x140001462a0)
	/Users/gabizou/go/go1.18/src/sync/mutex.go:203 +0xa4
database/sql.(*Stmt).connStmt(0x14000146240, {0x1051dcd08, 0x14000036160}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:2722 +0x22c
database/sql.(*Stmt).QueryContext(0x14000146240, {0x1051dcd08, 0x14000036160}, {0x1400056fed0, 0x1, 0x1})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:2776 +0x12c
database/sql.(*Stmt).Query(0x14000146240, {0x1400056fed0, 0x1, 0x1})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:2825 +0x64
project/snowflake_testTestSnowflakeConcurrentReads.func1()
	/Users/gabizou/code/go/demo/snowflake_integration_test.go:47 +0x2b0
created by project/snowflake_testTestSnowflakeConcurrentReads
	/Users/gabizou/code/go/project/snowflake_integration_test.go:40 +0x548

goroutine 10 [runnable]:
encoding/json.mapEncoder.encode({0x1051cfcf8}, 0x1400049e480, {0x1050eaee0, 0x14000787638, 0x195}, {0x0, 0x1})
	/Users/gabizou/go/go1.18/src/encoding/json/encode.go:797 +0x3cc
encoding/json.structEncoder.encode({{{0x14000526900, 0x2, 0x2}, 0x1400033ab70}}, 0x1400049e480, {0x1051390c0, 0x14000787630, 0x199}, {0x0, 0x1})
	/Users/gabizou/go/go1.18/src/encoding/json/encode.go:761 +0x310
encoding/json.ptrEncoder.encode({0x1400033abd0}, 0x1400049e480, {0x10509c760, 0x140005c0050, 0x196}, {0x0, 0x1})
	/Users/gabizou/go/go1.18/src/encoding/json/encode.go:945 +0x3bc
encoding/json.arrayEncoder.encode({0x14000246ec0}, 0x1400049e480, {0x1050a2560, 0x14000520330, 0x197}, {0x0, 0x1})
	/Users/gabizou/go/go1.18/src/encoding/json/encode.go:916 +0xfc
encoding/json.sliceEncoder.encode({0x14000247060}, 0x1400049e480, {0x1050a2560, 0x14000520330, 0x197}, {0x0, 0x1})
	/Users/gabizou/go/go1.18/src/encoding/json/encode.go:889 +0x410
encoding/json.structEncoder.encode({{{0x140000e6990, 0x1, 0x1}, 0x1400033ac00}}, 0x1400049e480, {0x105121be0, 0x14000520330, 0x199}, {0x0, 0x1})
	/Users/gabizou/go/go1.18/src/encoding/json/encode.go:761 +0x310
encoding/json.ptrEncoder.encode({0x1400033ac30}, 0x1400049e480, {0x10509c7e0, 0x14000520330, 0x16}, {0x0, 0x1})
	/Users/gabizou/go/go1.18/src/encoding/json/encode.go:945 +0x3bc
encoding/json.(*encodeState).reflectValue(0x1400049e480, {0x10509c7e0, 0x14000520330, 0x16}, {0x0, 0x1})
	/Users/gabizou/go/go1.18/src/encoding/json/encode.go:360 +0x7c
encoding/json.(*encodeState).marshal(0x1400049e480, {0x10509c7e0, 0x14000520330}, {0x0, 0x1})
	/Users/gabizou/go/go1.18/src/encoding/json/encode.go:332 +0xb8
encoding/json.Marshal({0x10509c7e0, 0x14000520330})
	/Users/gabizou/go/go1.18/src/encoding/json/encode.go:161 +0x60
github.com/snowflakedb/gosnowflake.(*snowflakeTelemetry).sendBatch(0x14000616000)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/telemetry.go:87 +0x21c
github.com/snowflakedb/gosnowflake.(*snowflakeConn).connectionTelemetry(0x14000610000, 0x140005cef78)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connection_util.go:83 +0x3cc
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, ...}, ...})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/driver.go:43 +0x1ec
github.com/snowflakedb/gosnowflake.Connector.Connect({{0x1051dadf8, 0x10564efa0}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, 0x0}, ...}}, ...)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connector.go:34 +0xdc
database/sql.(*DB).conn(0x14000206820, {0x1051dcd08, 0x14000036160}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1395 +0x994
database/sql.(*DB).prepare(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1588 +0x58
database/sql.(*DB).PrepareContext(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1557 +0x80
project/snowflake_testTestSnowflakeConcurrentReads.func1()
	/Users/gabizou/code/go/project/snowflake_integration_test.go:43 +0x170
created by project/snowflake_testTestSnowflakeConcurrentReads
	/Users/gabizou/code/go/project/snowflake_integration_test.go:40 +0x548

goroutine 11 [select]:
net/http.(*persistConn).roundTrip(0x140005265a0, 0x140001ee080)
	/Users/gabizou/go/go1.18/src/net/http/transport.go:2620 +0x85c
net/http.(*Transport).roundTrip(0x1056154a0, 0x14000834300)
	/Users/gabizou/go/go1.18/src/net/http/transport.go:594 +0x9d0
net/http.(*Transport).RoundTrip(0x1056154a0, 0x14000834200)
	/Users/gabizou/go/go1.18/src/net/http/roundtrip.go:17 +0x40
net/http.send(0x14000834100, {0x1051d4e38, 0x1056154a0}, {0xc0ea431461048b90, 0x1061b89aeb7, 0x10561d720})
	/Users/gabizou/go/go1.18/src/net/http/client.go:252 +0x374
net/http.(*Client).send(0x140004021b0, 0x14000834100, {0xc0ea431461048b90, 0x1061b89aeb7, 0x10561d720})
	/Users/gabizou/go/go1.18/src/net/http/client.go:176 +0xe8
net/http.(*Client).do(0x140004021b0, 0x14000834100)
	/Users/gabizou/go/go1.18/src/net/http/client.go:725 +0xdcc
net/http.(*Client).Do(0x140004021b0, 0x14000834100)
	/Users/gabizou/go/go1.18/src/net/http/client.go:593 +0x40
github.com/snowflakedb/gosnowflake.(*retryHTTP).execute(0x140001e81c0)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/retry.go:231 +0x3d4
github.com/snowflakedb/gosnowflake.postRestful({0x1051dcd08, 0x14000036160}, 0x1400057e0c0, 0x1400082e000, 0x14000800450, {0x14000623800, 0x151a, 0x1800}, 0xdf8475800, 0x1)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/restful.go:150 +0xc4
github.com/snowflakedb/gosnowflake.postAuth({0x1051dcd08, 0x14000036160}, 0x1400057e0c0, 0x1400080e010, 0x14000800450, {0x14000623800, 0x151a, 0x1800}, 0xdf8475800)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:225 +0x20c
github.com/snowflakedb/gosnowflake.authenticate({0x1051dcd08, 0x14000036160}, 0x140004fc180, {0x1400082a000, 0xe08, 0x1000}, {0x140007a4140, 0x31, 0x40})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:397 +0x116c
github.com/snowflakedb/gosnowflake.authenticateWithConfig(0x140004fc180)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:519 +0x6b4
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, ...}, ...})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/driver.go:40 +0x1a0
github.com/snowflakedb/gosnowflake.Connector.Connect({{0x1051dadf8, 0x10564efa0}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, 0x0}, ...}}, ...)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connector.go:34 +0xdc
database/sql.(*DB).conn(0x14000206820, {0x1051dcd08, 0x14000036160}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1395 +0x994
database/sql.(*DB).prepare(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1588 +0x58
database/sql.(*DB).PrepareContext(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1557 +0x80
project/snowflake_testTestSnowflakeConcurrentReads.func1()
	/Users/gabizou/code/go/project/snowflake_integration_test.go:43 +0x170
created by project/snowflake_testTestSnowflakeConcurrentReads
	/Users/gabizou/code/go/project/snowflake_integration_test.go:40 +0x548

goroutine 12 [select]:
github.com/snowflakedb/gosnowflake.(*retryHTTP).execute(0x1400080a150)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/retry.go:282 +0xd74
github.com/snowflakedb/gosnowflake.postRestful({0x1051dcd08, 0x14000036160}, 0x140004920c0, 0x14000764000, 0x140001311a0, {0x1400075e000, 0x1516, 0x1800}, 0xdf8475800, 0x1)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/restful.go:150 +0xc4
github.com/snowflakedb/gosnowflake.postAuth({0x1051dcd08, 0x14000036160}, 0x140004920c0, 0x14000010128, 0x140001311a0, {0x1400075e000, 0x1516, 0x1800}, 0xdf8475800)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:225 +0x20c
github.com/snowflakedb/gosnowflake.authenticate({0x1051dcd08, 0x14000036160}, 0x140002ea2a0, {0x140004b5000, 0xe04, 0x1000}, {0x1400013e4c0, 0x31, 0x40})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:397 +0x116c
github.com/snowflakedb/gosnowflake.authenticateWithConfig(0x140002ea2a0)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:519 +0x6b4
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, ...}, ...})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/driver.go:40 +0x1a0
github.com/snowflakedb/gosnowflake.Connector.Connect({{0x1051dadf8, 0x10564efa0}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, 0x0}, ...}}, ...)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connector.go:34 +0xdc
database/sql.(*DB).conn(0x14000206820, {0x1051dcd08, 0x14000036160}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1395 +0x994
database/sql.(*DB).prepare(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1588 +0x58
database/sql.(*DB).PrepareContext(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1557 +0x80
project/snowflake_testTestSnowflakeConcurrentReads.func1()
	/Users/gabizou/code/go/project/snowflake_integration_test.go:43 +0x170
created by project/snowflake_testTestSnowflakeConcurrentReads
	/Users/gabizou/code/go/project/snowflake_integration_test.go:40 +0x548

goroutine 13 [runnable]:
context.propagateCancel({0x1051dcd08, 0x14000036160}, {0x1051d6780, 0x140002ea9c0})
	/Users/gabizou/go/go1.18/src/context/context.go:250 +0x314
context.WithDeadline({0x1051dcd08, 0x14000036160}, {0xc0ea4320026d8948, 0x110ee59bec4, 0x10561d720})
	/Users/gabizou/go/go1.18/src/context/context.go:446 +0x2ac
net/http.setRequestCancel(0x140005c4200, {0x1051d4e38, 0x1056154a0}, {0xc0ea4320026d8948, 0x110ee59bec4, 0x10561d720})
	/Users/gabizou/go/go1.18/src/net/http/client.go:359 +0x144
net/http.send(0x140005c4100, {0x1051d4e38, 0x1056154a0}, {0xc0ea4320026d8948, 0x110ee59bec4, 0x10561d720})
	/Users/gabizou/go/go1.18/src/net/http/client.go:250 +0x33c
net/http.(*Client).send(0x14000402120, 0x140005c4100, {0xc0ea4320026d8948, 0x110ee59bec4, 0x10561d720})
	/Users/gabizou/go/go1.18/src/net/http/client.go:176 +0xe8
net/http.(*Client).do(0x14000402120, 0x140005c4100)
	/Users/gabizou/go/go1.18/src/net/http/client.go:725 +0xdcc
net/http.(*Client).Do(0x14000402120, 0x140005c4100)
	/Users/gabizou/go/go1.18/src/net/http/client.go:593 +0x40
github.com/snowflakedb/gosnowflake.(*retryHTTP).execute(0x14000190930)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/retry.go:231 +0x3d4
github.com/snowflakedb/gosnowflake.postRestful({0x1051dcd08, 0x14000036160}, 0x1400057e000, 0x14000666510, 0x140008003f0, {0x14000113800, 0x1512, 0x1800}, 0xdf8475800, 0x1)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/restful.go:150 +0xc4
github.com/snowflakedb/gosnowflake.postAuth({0x1051dcd08, 0x14000036160}, 0x1400057e000, 0x14000354190, 0x140008003f0, {0x14000113800, 0x1512, 0x1800}, 0xdf8475800)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:225 +0x20c
github.com/snowflakedb/gosnowflake.authenticate({0x1051dcd08, 0x14000036160}, 0x140004fc120, {0x14000829000, 0xe00, 0x1000}, {0x140007a4100, 0x31, 0x40})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:397 +0x116c
github.com/snowflakedb/gosnowflake.authenticateWithConfig(0x140004fc120)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:519 +0x6b4
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, ...}, ...})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/driver.go:40 +0x1a0
github.com/snowflakedb/gosnowflake.Connector.Connect({{0x1051dadf8, 0x10564efa0}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, 0x0}, ...}}, ...)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connector.go:34 +0xdc
database/sql.(*DB).conn(0x14000206820, {0x1051dcd08, 0x14000036160}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1395 +0x994
database/sql.(*DB).prepare(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1588 +0x58
database/sql.(*DB).PrepareContext(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1557 +0x80
project/snowflake_testTestSnowflakeConcurrentReads.func1()
	/Users/gabizou/code/go/project/snowflake_integration_test.go:43 +0x170
created by project/snowflake_testTestSnowflakeConcurrentReads
	/Users/gabizou/code/go/project/snowflake_integration_test.go:40 +0x548

goroutine 14 [select]:
github.com/snowflakedb/gosnowflake.(*retryHTTP).execute(0x140002fe540)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/retry.go:282 +0xd74
github.com/snowflakedb/gosnowflake.postRestful({0x1051dcd08, 0x14000036160}, 0x140005ac000, 0x1400040a2d0, 0x140002dd470, {0x140005e4700, 0x60c, 0x700}, 0x2540be400, 0x1)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/restful.go:150 +0xc4
github.com/snowflakedb/gosnowflake.(*snowflakeTelemetry).sendBatch(0x14000092000)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/telemetry.go:98 +0x590
github.com/snowflakedb/gosnowflake.(*snowflakeConn).connectionTelemetry(0x14000324000, 0x14000416f78)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connection_util.go:83 +0x3cc
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, ...}, ...})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/driver.go:43 +0x1ec
github.com/snowflakedb/gosnowflake.Connector.Connect({{0x1051dadf8, 0x10564efa0}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, 0x0}, ...}}, ...)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connector.go:34 +0xdc
database/sql.(*DB).conn(0x14000206820, {0x1051dcd08, 0x14000036160}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1395 +0x994
database/sql.(*DB).prepare(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1588 +0x58
database/sql.(*DB).PrepareContext(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1557 +0x80
project/snowflake_testTestSnowflakeConcurrentReads.func1()
	/Users/gabizou/code/go/project/snowflake_integration_test.go:43 +0x170
created by project/snowflake_testTestSnowflakeConcurrentReads
	/Users/gabizou/code/go/project/snowflake_integration_test.go:40 +0x548

goroutine 15 [select]:
net/http.(*Transport).getConn(0x1056154a0, 0x14000132140, {{}, 0x0, {0x1400068c200, 0x5}, {0x140007a4000, 0x32}, 0x0})
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1375 +0x620
net/http.(*Transport).roundTrip(0x1056154a0, 0x14000418300)
	/Users/gabizou/go/go1.18/src/net/http/transport.go:581 +0x8cc
net/http.(*Transport).RoundTrip(0x1056154a0, 0x14000418200)
	/Users/gabizou/go/go1.18/src/net/http/roundtrip.go:17 +0x40
net/http.send(0x14000418100, {0x1051d4e38, 0x1056154a0}, {0xc0ea431d6a0c0da8, 0x10e86527a78, 0x10561d720})
	/Users/gabizou/go/go1.18/src/net/http/client.go:252 +0x374
net/http.(*Client).send(0x140002dc3f0, 0x14000418100, {0xc0ea431d6a0c0da8, 0x10e86527a78, 0x10561d720})
	/Users/gabizou/go/go1.18/src/net/http/client.go:176 +0xe8
net/http.(*Client).do(0x140002dc3f0, 0x14000418100)
	/Users/gabizou/go/go1.18/src/net/http/client.go:725 +0xdcc
net/http.(*Client).Do(0x140002dc3f0, 0x14000418100)
	/Users/gabizou/go/go1.18/src/net/http/client.go:593 +0x40
github.com/snowflakedb/gosnowflake.(*retryHTTP).execute(0x140002fe070)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/retry.go:231 +0x3d4
github.com/snowflakedb/gosnowflake.postRestful({0x1051dcd08, 0x14000036160}, 0x14000492000, 0x14000146000, 0x140001c4cc0, {0x1400029e000, 0x151e, 0x1800}, 0xdf8475800, 0x1)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/restful.go:150 +0xc4
github.com/snowflakedb/gosnowflake.postAuth({0x1051dcd08, 0x14000036160}, 0x14000492000, 0x14000148058, 0x140001c4cc0, {0x1400029e000, 0x151e, 0x1800}, 0xdf8475800)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:225 +0x20c
github.com/snowflakedb/gosnowflake.authenticate({0x1051dcd08, 0x14000036160}, 0x140002ea1e0, {0x1400064f000, 0xe0c, 0x1000}, {0x140002e0040, 0x31, 0x40})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:397 +0x116c
github.com/snowflakedb/gosnowflake.authenticateWithConfig(0x140002ea1e0)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:519 +0x6b4
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, ...}, ...})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/driver.go:40 +0x1a0
github.com/snowflakedb/gosnowflake.Connector.Connect({{0x1051dadf8, 0x10564efa0}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, 0x0}, ...}}, ...)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connector.go:34 +0xdc
database/sql.(*DB).conn(0x14000206820, {0x1051dcd08, 0x14000036160}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1395 +0x994
database/sql.(*DB).prepare(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1588 +0x58
database/sql.(*DB).PrepareContext(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1557 +0x80
project/snowflake_testTestSnowflakeConcurrentReads.func1()
	/Users/gabizou/code/go/project/snowflake_integration_test.go:43 +0x170
created by project/snowflake_testTestSnowflakeConcurrentReads
	/Users/gabizou/code/go/project/snowflake_integration_test.go:40 +0x548

goroutine 16 [select]:
net/http.(*Transport).getConn(0x1056154a0, 0x140000923c0, {{}, 0x0, {0x14000598400, 0x5}, {0x140003400c0, 0x32}, 0x0})
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1375 +0x620
net/http.(*Transport).roundTrip(0x1056154a0, 0x14000294300)
	/Users/gabizou/go/go1.18/src/net/http/transport.go:581 +0x8cc
net/http.(*Transport).RoundTrip(0x1056154a0, 0x14000294200)
	/Users/gabizou/go/go1.18/src/net/http/roundtrip.go:17 +0x40
net/http.send(0x14000294100, {0x1051d4e38, 0x1056154a0}, {0xc0ea431d6a0c05d8, 0x10e86527201, 0x10561d720})
	/Users/gabizou/go/go1.18/src/net/http/client.go:252 +0x374
net/http.(*Client).send(0x1400033a7b0, 0x14000294100, {0xc0ea431d6a0c05d8, 0x10e86527201, 0x10561d720})
	/Users/gabizou/go/go1.18/src/net/http/client.go:176 +0xe8
net/http.(*Client).do(0x1400033a7b0, 0x14000294100)
	/Users/gabizou/go/go1.18/src/net/http/client.go:725 +0xdcc
net/http.(*Client).Do(0x1400033a7b0, 0x14000294100)
	/Users/gabizou/go/go1.18/src/net/http/client.go:593 +0x40
github.com/snowflakedb/gosnowflake.(*retryHTTP).execute(0x140001e83f0)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/retry.go:231 +0x3d4
github.com/snowflakedb/gosnowflake.postRestful({0x1051dcd08, 0x14000036160}, 0x140001c0540, 0x1400082e240, 0x140004e6150, {0x14000625000, 0x1512, 0x1800}, 0xdf8475800, 0x1)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/restful.go:150 +0xc4
github.com/snowflakedb/gosnowflake.postAuth({0x1051dcd08, 0x14000036160}, 0x140001c0540, 0x1400074c000, 0x140004e6150, {0x14000625000, 0x1512, 0x1800}, 0xdf8475800)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:225 +0x20c
github.com/snowflakedb/gosnowflake.authenticate({0x1051dcd08, 0x14000036160}, 0x140001c8ae0, {0x1400072d000, 0xe00, 0x1000}, {0x1400003c280, 0x31, 0x40})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:397 +0x116c
github.com/snowflakedb/gosnowflake.authenticateWithConfig(0x140001c8ae0)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:519 +0x6b4
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, ...}, ...})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/driver.go:40 +0x1a0
github.com/snowflakedb/gosnowflake.Connector.Connect({{0x1051dadf8, 0x10564efa0}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, 0x0}, ...}}, ...)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connector.go:34 +0xdc
database/sql.(*DB).conn(0x14000206820, {0x1051dcd08, 0x14000036160}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1395 +0x994
database/sql.(*DB).prepare(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1588 +0x58
database/sql.(*DB).PrepareContext(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1557 +0x80
project/snowflake_testTestSnowflakeConcurrentReads.func1()
	/Users/gabizou/code/go/project/snowflake_integration_test.go:43 +0x170
created by project/snowflake_testTestSnowflakeConcurrentReads
	/Users/gabizou/code/go/project/snowflake_integration_test.go:40 +0x548

goroutine 66 [runnable]:
encoding/json.stateEndValue(0x140000b8200, 0x20)
	/Users/gabizou/go/go1.18/src/encoding/json/scanner.go:277 +0x41c
encoding/json.(*Decoder).readValue(0x140000b8140)
	/Users/gabizou/go/go1.18/src/encoding/json/stream.go:103 +0x12c
encoding/json.(*Decoder).Decode(0x140000b8140, {0x10509b620, 0x140001be480})
	/Users/gabizou/go/go1.18/src/encoding/json/stream.go:63 +0xb8
github.com/snowflakedb/gosnowflake.postAuth({0x1051dcd08, 0x14000036160}, 0x1400012e000, 0x1400080e008, 0x14000800360, {0x140005ef800, 0x1512, 0x1800}, 0xdf8475800)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:232 +0x384
github.com/snowflakedb/gosnowflake.authenticate({0x1051dcd08, 0x14000036160}, 0x14000126000, {0x14000813000, 0xe00, 0x1000}, {0x140007a4080, 0x31, 0x40})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:397 +0x116c
github.com/snowflakedb/gosnowflake.authenticateWithConfig(0x14000126000)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/auth.go:519 +0x6b4
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, ...}, ...})
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/driver.go:40 +0x1a0
github.com/snowflakedb/gosnowflake.Connector.Connect({{0x1051dadf8, 0x10564efa0}, {{0x1400003e0b2, 0x7}, {0x1400003a18f, 0x14}, {0x0, 0x0}, {0x0, 0x0}, ...}}, ...)
	/Users/gabizou/code/go/project/github.com/snowflakedb/gosnowflake/connector.go:34 +0xdc
database/sql.(*DB).conn(0x14000206820, {0x1051dcd08, 0x14000036160}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1395 +0x994
database/sql.(*DB).prepare(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f}, 0x1)
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1588 +0x58
database/sql.(*DB).PrepareContext(0x14000206820, {0x1051dcd08, 0x14000036160}, {0x104f9e0d2, 0x3f})
	/Users/gabizou/go/go1.18/src/database/sql/sql.go:1557 +0x80
project/snowflake_testTestSnowflakeConcurrentReads.func1()
	/Users/gabizou/code/go/project/snowflake_integration_test.go:43 +0x170
created by project/snowflake_testTestSnowflakeConcurrentReads
	/Users/gabizou/code/go/project/snowflake_integration_test.go:40 +0x548

goroutine 72 [select]:
net/http.(*persistConn).writeLoop(0x140005b67e0)
	/Users/gabizou/go/go1.18/src/net/http/transport.go:2392 +0x104
created by net/http.(*Transport).dialConn
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1751 +0x2000

goroutine 135 [select]:
net.(*Resolver).lookupIPAddr(0x10561cd80, {0x1051dcd40, 0x140002325a0}, {0x104f70a88, 0x3}, {0x140007a4000, 0x2e})
	/Users/gabizou/go/go1.18/src/net/lookup.go:325 +0x6ac
net.(*Resolver).internetAddrList(0x10561cd80, {0x1051dcd40, 0x140002325a0}, {0x104f70a88, 0x3}, {0x140007a4000, 0x32})
	/Users/gabizou/go/go1.18/src/net/ipsock.go:288 +0x894
net.(*Resolver).resolveAddrList(0x10561cd80, {0x1051dcd40, 0x140002325a0}, {0x104f7130b, 0x4}, {0x104f70a88, 0x3}, {0x140007a4000, 0x32}, {0x0, ...})
	/Users/gabizou/go/go1.18/src/net/dial.go:221 +0x798
net.(*Dialer).DialContext(0x140001c87e0, {0x1051dcd40, 0x140002325a0}, {0x104f70a88, 0x3}, {0x140007a4000, 0x32})
	/Users/gabizou/go/go1.18/src/net/dial.go:406 +0x56c
net/http.(*Transport).dial(0x1056154a0, {0x1051dcd40, 0x14000232180}, {0x104f70a88, 0x3}, {0x140007a4000, 0x32})
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1169 +0x88
net/http.(*Transport).dialConn(0x1056154a0, {0x1051dcd40, 0x14000232180}, {{}, 0x0, {0x1400068c200, 0x5}, {0x140007a4000, 0x32}, 0x0})
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1607 +0x864
net/http.(*Transport).dialConnFor(0x1056154a0, 0x14000434000)
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1449 +0xb4
created by net/http.(*Transport).queueForDial
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1418 +0xe8

goroutine 71 [select]:
net/http.(*persistConn).readLoop(0x140005b67e0)
	/Users/gabizou/go/go1.18/src/net/http/transport.go:2213 +0xe70
created by net/http.(*Transport).dialConn
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1750 +0x1fa0

goroutine 94 [select]:
net.(*Resolver).lookupIPAddr(0x10561cd80, {0x1051dcd40, 0x1400054a360}, {0x104f70a88, 0x3}, {0x140003400c0, 0x2e})
	/Users/gabizou/go/go1.18/src/net/lookup.go:325 +0x6ac
net.(*Resolver).internetAddrList(0x10561cd80, {0x1051dcd40, 0x1400054a360}, {0x104f70a88, 0x3}, {0x140003400c0, 0x32})
	/Users/gabizou/go/go1.18/src/net/ipsock.go:288 +0x894
net.(*Resolver).resolveAddrList(0x10561cd80, {0x1051dcd40, 0x1400054a360}, {0x104f7130b, 0x4}, {0x104f70a88, 0x3}, {0x140003400c0, 0x32}, {0x0, ...})
	/Users/gabizou/go/go1.18/src/net/dial.go:221 +0x798
net.(*Dialer).DialContext(0x140001c87e0, {0x1051dcd40, 0x1400054a360}, {0x104f70a88, 0x3}, {0x140003400c0, 0x32})
	/Users/gabizou/go/go1.18/src/net/dial.go:406 +0x56c
net/http.(*Transport).dial(0x1056154a0, {0x1051dcd40, 0x1400054a180}, {0x104f70a88, 0x3}, {0x140003400c0, 0x32})
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1169 +0x88
net/http.(*Transport).dialConn(0x1056154a0, {0x1051dcd40, 0x1400054a180}, {{}, 0x0, {0x14000598400, 0x5}, {0x140003400c0, 0x32}, 0x0})
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1607 +0x864
net/http.(*Transport).dialConnFor(0x1056154a0, 0x140007b8000)
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1449 +0xb4
created by net/http.(*Transport).queueForDial
	/Users/gabizou/go/go1.18/src/net/http/transport.go:1418 +0xe8

goroutine 95 [select]:
net.cgoLookupIP({0x1051dccd0, 0x14000092400}, {0x104f70a88, 0x3}, {0x140003400c0, 0x2e})
	/Users/gabizou/go/go1.18/src/net/cgo_unix.go:228 +0x1e8
net.(*Resolver).lookupIP(0x10561cd80, {0x1051dccd0, 0x14000092400}, {0x104f70a88, 0x3}, {0x140003400c0, 0x2e})
	/Users/gabizou/go/go1.18/src/net/lookup_unix.go:96 +0x168
net.glob..func1({0x1051dccd0, 0x14000092400}, 0x14000652250, {0x104f70a88, 0x3}, {0x140003400c0, 0x2e})
	/Users/gabizou/go/go1.18/src/net/hook.go:23 +0x74
net.(*Resolver).lookupIPAddr.func1()
	/Users/gabizou/go/go1.18/src/net/lookup.go:319 +0xec
internal/singleflight.(*Group).doCall(0x10561cd90, 0x1400022c640, {0x14000340100, 0x32}, 0x14000092440)
	/Users/gabizou/go/go1.18/src/internal/singleflight/singleflight.go:95 +0x44
created by internal/singleflight.(*Group).DoChan
	/Users/gabizou/go/go1.18/src/internal/singleflight/singleflight.go:88 +0x48c

goroutine 96 [runnable]:
net._Cfunc_GoString(0x600002cd3480)
	_cgo_gotypes.go:134 +0x54
net.cgoLookupIPCNAME({0x104f70a88, 0x3}, {0x140003400c0, 0x2e})
	/Users/gabizou/go/go1.18/src/net/cgo_unix.go:189 +0x4f0
net.cgoIPLookup(0x1400054a480, {0x104f70a88, 0x3}, {0x140003400c0, 0x2e})
	/Users/gabizou/go/go1.18/src/net/cgo_unix.go:217 +0x54
created by net.cgoLookupIP
	/Users/gabizou/go/go1.18/src/net/cgo_unix.go:227 +0x16c

Debugger finished with the exit code 0

from gosnowflake.

rohantandon avatar rohantandon commented on August 15, 2024

Confirming that I believe the root cause of this issue is the connection configuration being updated during a call to QueryContext() or QueryRowContext(). This effectively means that any *sql.DB object created by passing a *gosnowflake.Config object to gosnowflake.NewConnector or gosnowflake.DSN will not be concurrency safe

Reusing a single *gosnowflake.Config object to create multiple connections can also result in a concurrent map writes panic because the config object is passed by reference. To get around this, each goroutine will need to also create its own Config object, or dereference the common *gosnowflake.Config object to create a copy by value.

from gosnowflake.

gabizou avatar gabizou commented on August 15, 2024

Just to get clarification: Does this behavior occur if you use a tx.PrepareContext? Looking at integrating Snowflake access for relatively async processes sharing the singular db instance as well.

from gosnowflake.

rohantandon avatar rohantandon commented on August 15, 2024

Just to get clarification: Does this behavior occur if you use a tx.PrepareContext? Looking at integrating Snowflake access for relatively async processes sharing the singular db instance as well.

@gabizou do you have a simple example that shows this panic occurring while using PrepareContext that you could share here?

from gosnowflake.

rohantandon avatar rohantandon commented on August 15, 2024

Thanks @gabizou . I tried running your example with the -race flag, and it turns out that this issue may be more widespread in the code than I previously thought. I also see it in populateErrorFields():

WARNING: DATA RACE
Write at 0x000100d14600 by goroutine 33:
  github.com/snowflakedb/gosnowflake.populateErrorFields()
      /Users/rohan/go/pkg/mod/github.com/snowflakedb/[email protected]/errors.go:87 +0x10a4
  github.com/snowflakedb/gosnowflake.(*snowflakeConn).exec()
      /Users/rohan/go/pkg/mod/github.com/snowflakedb/[email protected]/connection.go:131 +0x1269
  github.com/snowflakedb/gosnowflake.(*snowflakeConn).queryContextInternal()
      /Users/rohan/go/pkg/mod/github.com/snowflakedb/[email protected]/connection.go:316 +0x26a
  github.com/snowflakedb/gosnowflake.(*snowflakeConn).QueryContext()
      /Users/rohan/go/pkg/mod/github.com/snowflakedb/[email protected]/connection.go:290 +0x1cd
  github.com/snowflakedb/gosnowflake.(*snowflakeStmt).QueryContext()
      /Users/rohan/go/pkg/mod/github.com/snowflakedb/[email protected]/statement.go:34 +0x170
  database/sql.ctxDriverStmtQuery()
      /usr/local/opt/go/libexec/src/database/sql/ctxutil.go:82 +0x103
  database/sql.rowsiFromStatement()
      /usr/local/opt/go/libexec/src/database/sql/sql.go:2835 +0x206
  database/sql.(*Stmt).QueryContext()
      /usr/local/opt/go/libexec/src/database/sql/sql.go:2784 +0x226
  database/sql.(*Stmt).Query()
      /usr/local/opt/go/libexec/src/database/sql/sql.go:2825 +0x226
  gosnowflake-panic/simple.TestSnowflakeConcurrentReads.func1()
      /Users/rohan/Desktop/gosnowflake-panic/simple/main_test.go:43 +0x1cc
  gosnowflake-panic/simple.TestSnowflakeConcurrentReads.func3()
      /Users/rohan/Desktop/gosnowflake-panic/simple/main_test.go:56 +0x47

Previous write at 0x000100d14600 by goroutine 38:
  github.com/snowflakedb/gosnowflake.populateErrorFields()
      /Users/rohan/go/pkg/mod/github.com/snowflakedb/[email protected]/errors.go:87 +0x10a4
  github.com/snowflakedb/gosnowflake.(*snowflakeConn).exec()
      /Users/rohan/go/pkg/mod/github.com/snowflakedb/[email protected]/connection.go:131 +0x1269
  github.com/snowflakedb/gosnowflake.(*snowflakeConn).queryContextInternal()
      /Users/rohan/go/pkg/mod/github.com/snowflakedb/[email protected]/connection.go:316 +0x26a
  github.com/snowflakedb/gosnowflake.(*snowflakeConn).QueryContext()
      /Users/rohan/go/pkg/mod/github.com/snowflakedb/[email protected]/connection.go:290 +0x1cd
  github.com/snowflakedb/gosnowflake.(*snowflakeStmt).QueryContext()
      /Users/rohan/go/pkg/mod/github.com/snowflakedb/[email protected]/statement.go:34 +0x170
  database/sql.ctxDriverStmtQuery()
      /usr/local/opt/go/libexec/src/database/sql/ctxutil.go:82 +0x103
  database/sql.rowsiFromStatement()
      /usr/local/opt/go/libexec/src/database/sql/sql.go:2835 +0x206
  database/sql.(*Stmt).QueryContext()
      /usr/local/opt/go/libexec/src/database/sql/sql.go:2784 +0x226
  database/sql.(*Stmt).Query()
      /usr/local/opt/go/libexec/src/database/sql/sql.go:2825 +0x226
  gosnowflake-panic/simple.TestSnowflakeConcurrentReads.func1()
      /Users/rohan/Desktop/gosnowflake-panic/simple/main_test.go:43 +0x1cc
  gosnowflake-panic/simple.TestSnowflakeConcurrentReads.func3()
      /Users/rohan/Desktop/gosnowflake-panic/simple/main_test.go:56 +0x47

Admittedly, I don't appear to always get an error even with the -race flag, but from other examples I've run will randomly race at gosnowflake.populateSessionParameters() and gosnowflake.getArrayBindStageThreshold(), the latter with a concurrent map read and map write.

cc: @sfc-gh-dszmolka

from gosnowflake.

sfc-gh-dszmolka avatar sfc-gh-dszmolka commented on August 15, 2024

should be fixed with #706

from gosnowflake.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.