Skip to content

Crash if rejected by server. #2

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

Open
guijun opened this issue Oct 25, 2021 · 3 comments
Open

Crash if rejected by server. #2

guijun opened this issue Oct 25, 2021 · 3 comments

Comments

@guijun
Copy link

guijun commented Oct 25, 2021

err1 has to be an error if "not rc == utp.Accepted"

@unit-adm
Copy link
Member

Unitdb client does support dialing-in to multiple servers. You could specify list of servers to dial-in, so if a request is not accepted from a server it will continue to dial other servers and finally returns an error if attempts to all the servers are unsuccessful. The unitdb client returns an error if connection fails so you could choose in the application to terminate it or do some retry.

@guijun
Copy link
Author

guijun commented Oct 26, 2021

I see. but so the bug is still there. has to be fixed.

I'm afraid that the code doesn't work as you memtioned. please check these "return"s

Am I the first user? :-)

@unit-adm
Copy link
Member

A client example is given with unitdb server listening on single node on localhost port 6080.
The client attempt to connect a server node on localhost port 6081 that fails and then it attempt to connect the other server node running on localhost port 6080.

client, err := udb.NewClient(
"grpc://localhost:6081",
"UCBFDONCNJLaKMCAIeJBaOVfbAXUZHNPLDKKLDKLHZHKYIZLCDPQ",
udb.AddServer("grpc://localhost:6080"),
udb.WithCleanSession(),
udb.WithInsecure(),
udb.WithBatchDuration(1time.Second),
udb.WithKeepAlive(2
time.Second),
udb.WithPingTimeout(1*time.Second),
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants