-
Notifications
You must be signed in to change notification settings - Fork 898
Closed
Description
Describe the bug
When no request is sent to the RPC server for some time, an "i/o timeout" error will occur.
To Reproduce
Steps to reproduce the behavior:
- Go to kitex-examples/hello
- Change the time in
client/main.goto 10 seconds.
for {
req := &api.Request{Message: "my request"}
resp, err := client.Echo(context.Background(), req)
if err != nil {
log.Fatal(err)
}
log.Println(resp)
time. Sleep(time.Second * 10) // change to 10 seconds
addReq := &api.AddRequest{First: 512, Second: 512}
addResp, err := client.Add(context.Background(), addReq)
if err != nil {
log.Fatal(err)
}
log.Println(addResp)
time. Sleep(time.Second * 10) // change to 10 seconds
}- See error
Expected behavior
The Kitex client may not continuously be sending requests to the Kitex server.
I noticed that we can set WithReadWriteTimeout option to temporarily solve the issue, but the documentation states
WithReadWriteTimeout sets the read/write timeout on network. IMPORTANT: this option is not stable, and will be changed or removed in the future!!! We don't promise compatibility for this option in future versions!!!
Is there some other way to prevent this particular error from occurring?
Kitex version:
v0.5.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
