-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Session.IsConnected not detecting disconnection #472
Comments
Hello, |
What I was trying to achieve was checking connection before trying to run the query, but I guess it's better to check for Btw, |
Hello, I've done some more testing, it turns out here's a sample code to check (run it, then shut down rethinkdb server): package main
import (
"fmt"
"time"
"gopkg.in/rethinkdb/rethinkdb-go.v6"
)
func main() {
session, _ := rethinkdb.Connect(rethinkdb.ConnectOpts{
Address: "localhost:28015", InitialCap: 1, MaxOpen: 1})
for {
_, err := session.Server()
fmt.Printf("err:%s connected:%t\n", err, session.IsConnected())
time.Sleep(time.Second)
}
} the output is:
|
Also looked at the code, seems like |
Hi, should be fixed in 6.2.0 |
Hi, just tested 6.2.1 with the same code (#472 (comment)) , only the error message has changed, now it's |
Hello, I want to develop a project with the Betconstruct API. Do you have any projects? Thank you |
Did you find the example? |
When a session loses connection, the
Term.Run
returnsErrConnectionClosed
error, howeverthe
Session.IsConnected
method still reports that connection is alive (even after the failedRun
).The text was updated successfully, but these errors were encountered: