Closed provCristianMaluenda closed 5 years ago
I will have to make a test for this to reproduce and will get back to you.
Just to note you shouldn't need to directly do
pc := pool.Get()
you can just do pool.Execute(query)
Also is that the full panic trace? If not can you post the entire thing so I can try to trace back to where the client is not catching and re dialing a new connection.
Thanks for your help.
Sadly, there is not a panic trace. I only the message 2019/10/01 11:26:54 Lost connection to the database: write tcp 127.0.0.1:60044->127.0.0.1:8182: write: broken pipe
.
The error happens when my service lost the connection after response to some requests. If the service doesn't get any request, it is not a problem. For testing and development, I am using Gremlin Server.
Regards, Cristian.
Never mind, I found the problem. It was my code (I am new in Golang). The example was confused how it handles the errors:
go func(chan error) {
err := <-errs
log.Fatal("Lost connection to the database: " + err.Error())
}(errs) // Example of connection error handling logic
The issue was, log.Fatal()
write a log and then calls os.Exit(1)
.
Ah, yeah sorry about that. I should re-assess the existing docs.
Hi, Every time that my service lost the connection with Gremlin, the service throws an error and exit.
How can I recover my service after the WebSocket is closed? I thought using Pool will solve the problem but it doesn't. I don't know if I am doing something wrong.
Here is my PooledConnection:
The error is:
write tcp 127.0.0.1:58211->127.0.0.1:8182: write: broken pipe
Thanks