From: "inversion (Yura Babak) via ruby-core" Date: 2023-04-20T13:27:55+00:00 Subject: [ruby-core:113302] [Ruby master Bug#19609] net/http ignores open_timeout, read_timeout on Windows Issue #19609 has been reported by inversion (Yura Babak). ---------------------------------------- Bug #19609: net/http ignores open_timeout, read_timeout on Windows https://bugs.ruby-lang.org/issues/19609 * Author: inversion (Yura Babak) * Status: Open * Priority: Normal * ruby -v: ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x64-mingw-ucrt] * Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN ---------------------------------------- This small sample works fine on Linux (it takes 2 seconds to finish) but on Windows, it always fails with a timeout after some **magical 21 seconds**. ``` ruby require 'net/http' uri = URI 'http://1.2.3.4' http = Net::HTTP::new(uri.host, uri.port) http.open_timeout = 2 http.read_timeout = 2 time_start = Time.now begin response = http.get uri rescue Exception puts $!.inspect end time_total = Time.now - time_start puts time_total ``` Strange that I have installed different versions and the results are not consistent: **ruby 3.2.2** (2023-03-30 revision e51014f9c0) [x64-mingw-ucrt]: ``` # 21.0494375 ``` **ruby 3.1.2p20** (2022-04-12 revision 4491bb740a) [x64-mingw-ucrt]: ``` # 2.0190419 # ��� works as expected ``` **ruby 3.0.1p64** (2021-04-05 revision 0fb782ee38) [x64-mingw32]: ``` # 21.0423962 ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/