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-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.0 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_PASS 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 DE0CA211B3 for ; Sun, 2 Dec 2018 18:35:31 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id E2949120F59; Mon, 3 Dec 2018 03:35:28 +0900 (JST) Received: from o1678948x4.outbound-mail.sendgrid.net (o1678948x4.outbound-mail.sendgrid.net [167.89.48.4]) by neon.ruby-lang.org (Postfix) with ESMTPS id C4C7D120F1E for ; Mon, 3 Dec 2018 03:35:26 +0900 (JST) Received: by filter0076p3iad2.sendgrid.net with SMTP id filter0076p3iad2-16132-5C0425E9-33 2018-12-02 18:35:21.853847577 +0000 UTC m=+1463292.829810812 Received: from herokuapp.com (ec2-54-234-176-79.compute-1.amazonaws.com [54.234.176.79]) by ismtpd0039p1iad2.sendgrid.net (SG) with ESMTP id ot9bobMERLi7FTMXZRleMw Sun, 02 Dec 2018 18:35:21.888 +0000 (UTC) Date: Sun, 02 Dec 2018 18:35:23 +0000 (UTC) From: shevegen@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 65625 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15367 X-Redmine-Issue-Author: printercu X-Redmine-Sender: shevegen 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: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS4cALcTXPnRuVvpH7QcbDPhCLldM2Bru2pNb6 exD7OUdNDZR4/+XpBBnpDQWQQl6DOfRRk3+NXt7W2g9MesgqZOmYqStb5mMSboJuVX3xK+pKkHOWrI UD76HSuaoPJLzu547XRXBWFSP7CSkXZaqIzdBi9tJrxlfm0+ChQGCosWBg== X-ML-Name: ruby-core X-Mail-Count: 90229 Subject: [ruby-core:90229] [Ruby trunk Bug#15367] IO.select is not resumed when io-object gets closed 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 #15367 has been updated by shevegen (Robert A. Heiler). If I may inquire, how significant would the overhead be? While I think Akira's comment is perfectly fine on its own, I feel that if other people notice a different behaviour between different operating systems then this may surprise them. (I myself use almost exclusively Linux.) ---------------------------------------- Bug #15367: IO.select is not resumed when io-object gets closed https://bugs.ruby-lang.org/issues/15367#change-75347 * Author: printercu (Max Melentiev) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- Here is sample code: ~~~ ruby rp, wp = IO.pipe t2 = Thread.new { IO.select([rp]) } # This also does not work: # t2 = Thread.new { IO.select([rp], nil, [rp]) } sleep 0.01 rp.close t2 # => # ~~~ It happens only on linux, tested with 2.5.1, 2.6.0-preview2. On macOS it gives error, as expected: ~~~ # terminated with exception (report_on_exception is true): Traceback (most recent call last): 1: from (pry):5:in `block in
' (pry):5:in `select': Bad file descriptor (Errno::EBADF) > t2 => # ~~~ -- https://bugs.ruby-lang.org/