Skip to content
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

Timeout bug #373

Open
drawnwren opened this issue Oct 8, 2024 · 1 comment · May be fixed by #471
Open

Timeout bug #373

drawnwren opened this issue Oct 8, 2024 · 1 comment · May be fixed by #471
Assignees
Labels
bug Something isn't working SDKs

Comments

@drawnwren
Copy link

drawnwren commented Oct 8, 2024

Here's the type signature of the httpx:AsyncClient.request method:

    async def request(
        self,
        method: str,
        url: URL | str,
        *,
        content: RequestContent | None = None,
        data: RequestData | None = None,
        files: RequestFiles | None = None,
        json: typing.Any | None = None,
        params: QueryParamTypes | None = None,
        headers: HeaderTypes | None = None,
        cookies: CookieTypes | None = None,
        auth: AuthTypes | UseClientDefault | None = USE_CLIENT_DEFAULT,
        follow_redirects: bool | UseClientDefault = USE_CLIENT_DEFAULT,
        timeout: TimeoutTypes | UseClientDefault = USE_CLIENT_DEFAULT,
        extensions: RequestExtensions | None = None,
    ) -> Response:

It's important that they use a custom type to indicate that no timeout is set. When you wrap their client here:

base_timeout=self.get_timeout(),

You use None as the default timeout, and pass the default timeout value to get here:

httpx treats timeout=None as no timeout at all (not the client default timeout), and this means that we're seeing some stuck connections in our code.

@AngeloGiacco AngeloGiacco self-assigned this Feb 3, 2025
@AngeloGiacco AngeloGiacco added bug Something isn't working SDKs labels Feb 3, 2025
@AngeloGiacco
Copy link
Collaborator

hey thanks for this issue and the pointer! we will ship a fix soon

@AngeloGiacco AngeloGiacco linked a pull request Feb 4, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SDKs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants