-
Notifications
You must be signed in to change notification settings - Fork 97
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
Updated version do not work #185
Comments
Yes, v0.26.3 contains some deadline handling changes, but more info is needed: |
I use connection with:
and I do not used context.Deadline. My connectString just connect descriptor like I open connection and setting with: database.pool, err = sql.Open(database.Driver, database.Dsn)
...
database.pool.SetMaxIdleConns(database.MaxIdleCons)
database.pool.SetMaxOpenConns(database.MaxOpenCons) I use ping for checking connection: db.pool.PingContext(ctx) and query with context: ctx, cancel := context.WithTimeout(context.Background(), time.Duration(query.Timeout)*time.Second)
defer cancel()
rows, err := database.pool.QueryContext(ctx, query.SQL) Version v0.25.3 worked fine, but new version do not work. Ping and query return error about context deadline. I tried to use |
Can you provide output after setting this environment variable.
on shell, after setting above variable, you can run the program. you should see something like this in console, can you share your console output. I tried simple query, ping with v0.25.3 , latest version, could not see difference . may be something i am missing. ODPI [670121] 2021-09-25 11:15:11.827: ODPI-C 4.2.1 |
Sorry for delay. Something strange. I wrote new simple program, like: package main
import (
"context"
"database/sql"
"fmt"
_ "github.com/godror/godror"
"log"
"time"
)
// Database struct.
type Database struct {
Dsn string
ID string `yaml:"id"`
Host string `yaml:"host"`
User string `yaml:"user"`
Password string `yaml:"password"`
Database string `yaml:"database"`
Port int `yaml:"port"`
Driver string `yaml:"driver"`
MaxIdleCons int `yaml:"maxIdleCons"`
MaxOpenCons int `yaml:"maxOpenCons"`
ConnectString string `yaml:"connectString"`
connection string
pool *sql.DB
}
var (
database Database
err error
)
func main() {
database = Database{
// setup my structure with auth data
}
database.Dsn = fmt.Sprintf(
`user="%s" password="%s" connectString="%s"`,
database.User, database.Password, database.ConnectString)
log.Printf("Setup connection for DB: %s", database.connection)
database.pool, err = sql.Open(database.Driver, database.Dsn)
if err != nil {
log.Fatalf("Error on setting connection to database (%s): %v", database.connection, err)
}
database.pool.SetMaxIdleConns(database.MaxIdleCons)
database.pool.SetMaxOpenConns(database.MaxOpenCons)
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(5)*time.Second)
defer cancel()
if err := database.pool.PingContext(ctx); err != nil {
log.Fatalf("Error on check connection (ping) on db (%v): %v", database.ID, err)
}
log.Printf("Ping successful")
} and I got successful ping:
One more. I tried to use
These library I use in my application. Can this affect? I was disable debug, add simple query, (used
After that i just replace logrus with log, and ping was successful. This is conflict with other library? |
https://github.com/sirupsen/logrus/blob/master/terminal_check_bsd.go seems to cause the SIGSEGV. |
Just avoid logrus: see sirupsen/logrus#1275 |
:( my bad. I forgot to initialize logrus. After that all is working. Ping and query. I will check again my main application. I will close issue later, if you do not mind. |
Describe the bug
I used godror version v0.25.3, after updating to version v0.26.3 without changes in code I have errors in my logs: context deadline exceeded.
To Reproduce
Just:
in my project directory.
Expected behavior
After updating all work correctly.
Error output
Copy the error output (panic, stack trace),
or the output of running with
DPI_DEBUG_LEVEL=92
.Your oracle client version
19.8
Your godror version
v0.26.3
Your go version
1.17.1
Your gcc version
Machine (please complete the following information):
Additional context
Add any other context about the problem here.
What happened? What changed on these versions?
The text was updated successfully, but these errors were encountered: