From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 560701F4B4 for ; Tue, 12 Jan 2021 04:57:31 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7E190120A55; Tue, 12 Jan 2021 13:56:41 +0900 (JST) Received: from xtrwkhkc.outbound-mail.sendgrid.net (xtrwkhkc.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 7D09A120A4D for ; Tue, 12 Jan 2021 13:56:39 +0900 (JST) Received: by filterdrecv-p3iad2-74bd9fb996-dck9c with SMTP id filterdrecv-p3iad2-74bd9fb996-dck9c-20-5FFD2C35-1C 2021-01-12 04:57:25.376694262 +0000 UTC m=+2786120.750537991 Received: from herokuapp.com (unknown) by ismtpd0002p1iad2.sendgrid.net (SG) with ESMTP id w56fAEP7RvCfWHXIScHdyw for ; Tue, 12 Jan 2021 04:57:25.365 +0000 (UTC) Date: Tue, 12 Jan 2021 04:57:25 +0000 (UTC) From: akr@fsij.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 77918 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Feature X-Redmine-Issue-Id: 17528 X-Redmine-Issue-Author: mohamedhafez X-Redmine-Sender: akr X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: =?us-ascii?Q?wr6S=2F0rS9KcpExQc7ATPeOPNOIjnBAThnQXlHCXEyHCoPNJ+DTxESMCHJB89Vm?= =?us-ascii?Q?TcMty8vldcdwLtMPACWB+YPtqY+I2CBrH4Eo98g?= =?us-ascii?Q?pJvbyOWK589hnIKXvj5qfPVAPW2gt8N=2FzV1rGiB?= =?us-ascii?Q?OzJsN6i7nkf1+qr7cRiJml6DCfmNB8Qxq82KdEy?= =?us-ascii?Q?4l2tGocIz+PGhHps6QWGAmVS=2Fm37wdeVt3A=3D=3D?= To: ruby-core@ruby-lang.org X-Entity-ID: b/2+PoftWZ6GuOu3b0IycA== X-ML-Name: ruby-core X-Mail-Count: 102015 Subject: [ruby-core:102015] [Ruby master Feature#17528] Make Addrinfo.getaddrinfo fall back to Timeout.timeout for :resolv_timeout X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #17528 has been updated by akr (Akira Tanaka). I think Timeout.timeout doesn't work for Addrinfo.getaddrinfo because Timeout.timeout cannot interrupt getaddrinfo function in C. ---------------------------------------- Feature #17528: Make Addrinfo.getaddrinfo fall back to Timeout.timeout for :resolv_timeout https://bugs.ruby-lang.org/issues/17528#change-89863 * Author: mohamedhafez (Mohamed Hafez) * Status: Open * Priority: Normal ---------------------------------------- Currently, `Addrinfo.getaddrinfo` ignores the `:resolv_timeout` option if we are on a system without `getaddrinfo_a`. It would be great if instead it would fall back to using `Timeout.timeout`. That way, we could get rid of a lot of the usage of `Timeout.timeout` for systems that *do* have `getaddrinfo_a`. For example, for Net::HTTP#connect we could easily then do something like this: https://github.com/ruby/ruby/compare/master...mohamedhafez:patch-3?diff=split. The motivation for this is that the usage of Timeout.timeout is inherently unsafe, and it would be great to stop using it where we can (see https://www.mikeperham.com/2015/05/08/timeout-rubys-most-dangerous-api/ and http://blog.headius.com/2008/02/ruby-threadraise-threadkill-timeoutrb.html) -- https://bugs.ruby-lang.org/