Git Product home page Git Product logo

Comments (4)

jhump avatar jhump commented on September 21, 2024

It looks like my particular issue may be a little different than described. I was definitely seeing "timeout: no recent network activity" in my logs, which is why I thought quic.IdleTimeoutError may be to blame.

However, it looks like the actual error that a client is much more likely to receive is an http3.Error with a code of H3_REQUEST_CANCELLED. With quic.IdleTimeoutError, my work-around was check for instances of net.Error where err.Timeout() returned true. But with this latest observation, I must put work-around code that is quite bespoke to this library to properly detect context-related errors. I suspect an appropriate improvement would not involve touching http3.Error but instead something else in the round-tripper so that it can correctly return context.Canceled or context.DeadlineExceeded when an http3.Error is triggered via the context.

from quic-go.

marten-seemann avatar marten-seemann commented on September 21, 2024

I'm not sure I understand under which condition exactly you expect the context cancelation error.

In general, an idle timeout can occur at any time during the handshake or the connection, if the other peer suddenly goes away without telling us. There's no context being canceled here, so we shouldn't return a context cancelation error.

Am I right to assume that you're setting the context on the http.Request, cancel that context, and now expect the error on RoundTripper.RoundTrip to be a context cancelation error? Is that what HTTP/2 does? Assuming that's the case, I agree that this would be the correct behavior, and we should make sure that HTTP/3 does the same (I haven't checked what it does right now).

from quic-go.

jhump avatar jhump commented on September 21, 2024

Am I right to assume that you're setting the context on the http.Request, cancel that context, and now expect the error on RoundTripper.RoundTrip to be a context cancelation error?

Yes. That is what the standard lib net/http stuff does, with the exception of the bug I linked above, where the dial operation (when no existing connection is in the pool) can instead return os. ErrDeadlineExceeded.

For the case of the error I'm seeing, I think the HTTP/3 round tripper implementation could examine the http.Error and the request's context and then massage the error to wrap the error and return something that is easier to inspect.

from quic-go.

marten-seemann avatar marten-seemann commented on September 21, 2024

Closing in favor of #4205.

from quic-go.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.