I believe the last use of the timeout() method was removed in 2008 76c2840
I believe the only use of the timeout library is OpenTimeout, ReadTimeout & WriteTimeout inheriting from Timeout::Error.
The test suite does not enforce this - I made them inherit from StandardError and the test suite still passes (although. n.b., it still passes with ReadTimeout removed, so maybe coverage isn't great).
I believe this was done for historical reasons. in the above-mentioned commit removing use of timeout, explicit raising of Timeout::Error (nee Timeout::TimeoutError) was added. After that, the ancestry was maintained when other changes were made. interesting commits: 43901df c0b1e4b 8e671df
I imagine this was done so that calling code which was expecting to rescue Timeout::Error wouldn't break.
Here's an example of client code rescuing Timeout::Error. It also rescues Net:ReadTimeout https://github.com/ruby/net-http/blob/705e7c0f65af0680bc3970063cbddf7889943184/lib/net/http.rb#L2358-L2362 - i'm guessing it was initially only Timeout::Error and the redundancy was added at some point
Would it be a good idea to phase out this dependency? My naive thinking is it could be fairly aggressive and land with ruby 3.4, since the high impact dependencies (ruby/net-*) are controllable. And also the change could be called out in release notes.
(sorry if this is already documented/discussed elsewhere)
I believe the last use of the
timeout()method was removed in 2008 76c2840I believe the only use of the
timeoutlibrary isOpenTimeout,ReadTimeout&WriteTimeoutinheriting fromTimeout::Error.The test suite does not enforce this - I made them inherit from
StandardErrorand the test suite still passes (although. n.b., it still passes withReadTimeoutremoved, so maybe coverage isn't great).I believe this was done for historical reasons. in the above-mentioned commit removing use of timeout, explicit raising of
Timeout::Error(neeTimeout::TimeoutError) was added. After that, the ancestry was maintained when other changes were made. interesting commits: 43901df c0b1e4b 8e671dfI imagine this was done so that calling code which was expecting to rescue Timeout::Error wouldn't break.
Here's an example of client code rescuing
Timeout::Error. It also rescuesNet:ReadTimeouthttps://github.com/ruby/net-http/blob/705e7c0f65af0680bc3970063cbddf7889943184/lib/net/http.rb#L2358-L2362 - i'm guessing it was initially onlyTimeout::Errorand the redundancy was added at some pointWould it be a good idea to phase out this dependency? My naive thinking is it could be fairly aggressive and land with ruby 3.4, since the high impact dependencies (ruby/net-*) are controllable. And also the change could be called out in release notes.
(sorry if this is already documented/discussed elsewhere)