From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_PASS,T_DKIM_INVALID, T_RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 728E11F7D2 for ; Mon, 5 Jun 2017 16:17:05 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 433A812076B; Tue, 6 Jun 2017 01:17:03 +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 C19A7120766 for ; Tue, 6 Jun 2017 01:17:00 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=WpAK0gc7go8+VEiudzIOf/TrhVY=; b=pQ6xYNnr0TkD0lA/p0 goN9fKyHWl/7wlWq1PYVAmGdVUKsEENGvL30lSnYH8yKtclLBKkvI1kmgMU2/zHW WUplF1Y76vlHu9M6lWbi9DlpYYju6cdzDnxvmFOYvMbHNSkDNwOAEZIgvpEjD9qk mhqjxiliIEHfDNr41Lzq4bAhc= Received: by filter0605p1mdw1.sendgrid.net with SMTP id filter0605p1mdw1-2783-593583F6-15 2017-06-05 16:16:54.343131138 +0000 UTC Received: from herokuapp.com (ec2-54-160-160-161.compute-1.amazonaws.com [54.160.160.161]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id i4onuBzlQJyVXeD5UCpwsg for ; Mon, 05 Jun 2017 16:16:54.301 +0000 (UTC) Date: Mon, 05 Jun 2017 16:16:54 +0000 From: sir.nickolas@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56612 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13632 X-Redmine-Issue-Author: nvashchenko X-Redmine-Sender: nvashchenko 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS7WMcVomD1n+J8AcT18pYaGhioUiu4KPZyu2P YkScybxmCtIY2PLaL9mcPcr5zg0ap3uRsaX4nFJb6tqtuSnHDI4T4+sMTEww9i95qvYjXcr0xkqK9P xgfEjV98iPRrbyJ1+GAoScaOB+36I0iH6yPPiwlzztK+Jt/Cv1iEE8iKRw== X-ML-Name: ruby-core X-Mail-Count: 81581 Subject: [ruby-core:81581] [Ruby trunk Bug#13632] Not processable interrupt queue for a thread after it's notified that FD is closed in some other thread. 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 #13632 has been reported by nvashchenko (Nikolay Vashchenko). ---------------------------------------- Bug #13632: Not processable interrupt queue for a thread after it's notified that FD is closed in some other thread. https://bugs.ruby-lang.org/issues/13632 * Author: nvashchenko (Nikolay Vashchenko) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: 2.2.x, 2.3.x, 2.4.x, 2.5.x * Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN ---------------------------------------- In the bugfix for https://bugs.ruby-lang.org/issues/13076 has been introduced another bug, caused by a busy waiting in rb_notify_fd_close method, while the FD is being released. During this waiting, it pumps huge amounts of the ruby_error_stream_closed errors into thread's interrupt queue, which almost all stay there unprocessed. It can be up for several hundred of exceptions in the queue, depending on circumstances. ~~~ ruby a = [] t = [] 10.times do r,w = IO.pipe a << [r,w] t << Thread.new do while r.gets end rescue IOError # Interrupt queue is full and all IO is broken Thread.current.pending_interrupt? # Expected to be false, because it's already rescued IO.sysopen ("/dev/tty") # Expected not to throw an error. On each such call, it dequeues the next item from interrupt queue until there's none end end a.each do |r,w| w.puts "test" w.close r.close end t.each do |th| th.join end ~~~ Output: ~~~ text Traceback (most recent call last): 1: from test2.rb:9:in `block (2 levels) in
' test2.rb:9:in `sysopen': stream closed in another thread (IOError) ~~~ -- https://bugs.ruby-lang.org/