Git Product home page Git Product logo

Comments (5)

kstephens avatar kstephens commented on August 17, 2024

This is a pretty serious bug.

from httpclient.

nahi avatar nahi commented on August 17, 2024

Yes, it's an API change. Timeout::Error (::TimeoutError) should be handled by the code who called Timeout.timeout.

I don't know how we treat this kind of nested timeout...

from httpclient.

kstephens avatar kstephens commented on August 17, 2024

There is nothing for httpclient to do except throw a subclass of ::TimeoutError. It doesn't need to know anything about the outer timeout. As stated the proposed change restores old semantics and still allows new code to distinguish between ::TimeoutError and HTTPClient::TimeoutErrors.

Want a unit test to illustrate the issue and the fix?

from httpclient.

nahi avatar nahi commented on August 17, 2024

I don't want to throw non StandardError from a library. In 1.8, it's not a StandardError.

0% ruby187 -rtimeout -e 'p Timeout::Error.ancestors'
[Timeout::Error, Interrupt, SignalException, Exception, Object, Kernel]
0% ruby -rtimeout -e 'p Timeout::Error.ancestors' 
[Timeout::Error, RuntimeError, StandardError, Exception, Object, Kernel, BasicObject]

So as a CRuby committer hat, I want to find the way to handle this kind of nested timeout.

As a workaround, can you use httpclient's timeout instead of outer one? (I don't think so...)

from httpclient.

nahi avatar nahi commented on August 17, 2024

I close this issue as "Wont' fix" because it's a "BUG" that introduced incompatible change to API as original reporter stated. But I still am thinking that it's required change (::Timeout::Error == ::TimeoutError must be handled only by timeout library, not by others) so I cannot revert the change (I cannot change ReceiveTimeout, etc. to a subclass of ::TimeoutError.)

Since this API incompatible BUG lasted over 3 years I assume this change was accepted.

from httpclient.

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.