Skip to content

http.client does not finish current streams after a connection lost #9086

@DerekBum

Description

@DerekBum

Bug description

I am trying to use the http.client library to communicate with etcd HTTP stream API. Everything functions properly until the connection with etcd is unexpectedly lost. In this case, all current streams hang until the request timeout ends.

In fact, this is a bug in curl (see curl/curl#11769).

Tarantool version

tarantool version is 2.11.0-0-g247a9a418.

Operating system

Ubuntu 22.04.2 LTS.
Linux 6.2.0-26-generic x86-64.

Steps to reproduce

  1. Run etcd (for installation please check this guide).
  2. Execute in tarantool:
opts = {chunked=true, keepalive_interval = 1, keepalive_idle = 1, verbose = true}
client = require("http.client").new()
stream = client:post("http://localhost:2379/v3/watch", nil, opts)
stream:read(1, 10000)
  1. Close etcd server: killall -SIGKILL $(pidof etcd)
  2. See that the reproducer hangs.

Actual behavior

tarantool instance hangs (until the timeout of the read ends).

Expected behavior

I expected that the request finishes (with an error) due to a lost connection. So the reproducer will finish too.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions