You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
updated from 2.8.7 to 2.8.8 and my unit tests are terminating now with new errors:
connection break due to context timeout
sample code
`
dbh, err = sqlx.Open(driver, source)
if err != nil {
return nil, err
}
// Create a context with timeout, using the empty
// context.Background() as the parent.
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
defer cancel()
// Use this when testing the connection pool.
if err = dbh.PingContext(ctx); err != nil {
// error occours here
return nil, err
}
`
I find the bug
StartContext will create go-routine with each call
and EndContext should stop this go-routine using a stop channel
so I should create a stop-channel for each go-routine [the bug I use one stop channel for all]
Unfortunately, the first one of the errors is still alive even with 2.8.9
I am connecting with a wrong credential and expect a "ORA-01017" as return. But i still get the "connection break due to context timeout" error
updated from 2.8.7 to 2.8.8 and my unit tests are terminating now with new errors:
connection break due to context timeout
sample code
`
dbh, err = sqlx.Open(driver, source)
if err != nil {
return nil, err
}
// Create a context with timeout, using the empty
// context.Background() as the parent.
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
defer cancel()
// Use this when testing the connection pool.
if err = dbh.PingContext(ctx); err != nil {
// error occours here
return nil, err
}
`
source = 'oracle://dummy:dummy@:0/?connStr=%28DESCRIPTION%3D%28ADDRESS_LIST%3D%28ADDRESS%3D%28PROTOCOL%3DTCP%29%28HOST%3D127.0.0.1%29%28PORT%3D21522%29%29%29%28CONNECT_DATA%3D%28SERVER%3DDEDICATED%29%28SERVICE_NAME%3DFREEPDB1%29%29%29'
Tested with Oracle23.3 Free. Timeout is set to 10 (sec)
I can confirm the same code is working with 2.8.7
The text was updated successfully, but these errors were encountered: