Skip to content

i/o timeout when no request is sent after some time #964

@zsh-eng

Description

@zsh-eng

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:

  1. Go to kitex-examples/hello
  2. Change the time in client/main.go to 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
	}
  1. 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?

Screenshots
image

Kitex version:
v0.5.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions