-
Notifications
You must be signed in to change notification settings - Fork 231
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
bug-fixing: PostgreSQL failed to check if the server wasn't turn on the SSL #286
Conversation
Codecov ReportBase: 99.67% // Head: 99.67% // Increases project coverage by
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #286 +/- ##
=======================================
Coverage 99.67% 99.67%
=======================================
Files 82 82
Lines 5488 5503 +15
=======================================
+ Hits 5470 5485 +15
Misses 12 12
Partials 6 6
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
probe/client/postgres/postgres.go
Outdated
return false, fmt.Sprintf("Query error - [%s], %v", v, err) | ||
} | ||
if !rows.Next() { | ||
rows.Close() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need call db.Close()
in error cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice catch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put the code in for loop into functionverifyData()
, and use the defer db.Close() and defer rows.Close()
inside.
Please review it again
close #285
How to Reproduce
disable the SSL in
prostgresql.conf
by commenting on the following configurationEaseProbe config.yaml
Fix
if TLS in the client is not configured, we need to configure it with a nil