8000 AmpHttpClient missing a new timeout function call · Issue #36911 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
AmpHttpClient missing a new timeout function call #36911
Closed
@richard4339

Description

@richard4339

Symfony version(s) affected: 5.1.0-RC1

Description
AmpHttpClient's request method sets these timeout values:

$request->setTcpConnectTimeout(1000 * $options['timeout']);
$request->setTlsHandshakeTimeout(1000 * $options['timeout']);
$request->setTransferTimeout(1000 * $options['max_duration']);

However, the amphp/http-client module introduced a fourth timeout in version 4.3.0 released on May 3rd, an inactivity timeout, as seen here: amphp/http-client#263

How to reproduce
Make a request and sleep for 11 seconds before calling getContent().

Possible Solution
Adding $request->setInactivityTimeout(1000 * $options['max_duration']); works, but I'm not sure that is the appropriate $options value to use (timeout would make sense, as would a non-existent new option).
Another temporary option could be to restrict the package to version 4.2.2 when Symfony 5.1 is released?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0