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=-2.8 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_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 7B9591F5AE for ; Sat, 25 Jul 2020 12:42:47 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 73243120971; Sat, 25 Jul 2020 21:42:17 +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 1186A120970 for ; Sat, 25 Jul 2020 21:42:13 +0900 (JST) Received: by filterdrecv-p3las1-7754f7d4cc-x8q2r with SMTP id filterdrecv-p3las1-7754f7d4cc-x8q2r-21-5F1C28BE-5D 2020-07-25 12:42:38.637465254 +0000 UTC m=+2572134.968340987 Received: from herokuapp.com (unknown) by ismtpd0015p1iad2.sendgrid.net (SG) with ESMTP id 7LCMwBx_RhmTbozN5Bjnog for ; Sat, 25 Jul 2020 12:42:38.526 +0000 (UTC) Date: Sat, 25 Jul 2020 12:42:38 +0000 (UTC) From: nagachika00@gmail.com Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 75125 X-Redmine-Project: ruby-master X-Redmine-Issue-Tracker: Bug X-Redmine-Issue-Id: 16780 X-Redmine-Issue-Author: rgerard X-Redmine-Issue-Assignee: shugo X-Redmine-Sender: nagachika 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?O2wxg26uOO6cft6GjkEp=2FGevTnH9lR=2FEdG60AX3F8=2FDMwlyNID0Gsj8wU3KldY?= =?us-ascii?Q?Y0gvDKifQHbl0A7p=2FsfbaidfbDGXNslvM92zN2k?= =?us-ascii?Q?8o9FCjZ5PpW3xiN7D8zG0Q8NKnT4=2FsU=2FspzXWj7?= =?us-ascii?Q?X2surMdyZWT0KIaHpjFCEpBn2atflI6avz1fd+g?= =?us-ascii?Q?aHjFJBc7uCI0FpDXUraKv9yq7NAXHBPAjMnEDOc?= =?us-ascii?Q?2W9Gxs8CqemdLzGlY=3D?= To: ruby-core@ruby-lang.org X-ML-Name: ruby-core X-Mail-Count: 99333 Subject: [ruby-core:99333] [Ruby master Bug#16780] Net::FTP PUT command issuing Net::ReadTimeout too quickly 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 #16780 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 2.5: DONTNEED, 2.6: DONTNEED, 2.7: REQUIRED to 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONE ruby_2_7 578bacc471fa3fa14f8607fe67adccce21e81657 merged revision(s) 5e81e8675a020ecd493620a4ff38db8fcf4b972a. ---------------------------------------- Bug #16780: Net::FTP PUT command issuing Net::ReadTimeout too quickly https://bugs.ruby-lang.org/issues/16780#change-86728 * Author: rgerard (Ryan Gerard) * Status: Closed * Priority: Normal * Assignee: shugo (Shugo Maeda) * ruby -v: 2.7.1 * Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONE ---------------------------------------- This is my first time writing up an issue for this community, so I apologize if this is written in an abnormal way than your normal issues. We recently upgraded from ruby 2.6.5 to 2.7.1. Almost immediately, we started seeing issues with some of our application code that utilizes Net::FTP. All calls to #put to an external FTP server we communicate with were resulting in a Net::ReadTimeout exception being throw. Upon examination of the external FTP server, we can see that the file was successfully transferred, although the Net::ReadTimeout exception begin thrown caused confusion on our end. Looking over the changes that were part of the ruby 2.7.0 release, I believe this commit (https://github.com/ruby/ruby/commit/5be34d6a3310065850c0c530db6936415124b5d9), which was a fix for this bug (https://bugs.ruby-lang.org/issues/16413) is the root of the issue. I translated the japanese, and I understand that the change to add the `begin` and `ensure` blocks were to make sure the connection was closed in case an exception is thrown during the transfer. However, the additional change to the connection read_timeout to 1 second was a little puzzling. I can see that this logic was copied from `retrbinary` and `retrlines`, but I'm uncertain why the connection read_timeout should be changed to 1 second. I believe the right fix is to remove the change to the connection read_timeout. Here is the stack trace for the exception we're getting during the call to #put: ``` ruby Net::ReadTimeout with # /usr/local/lib/ruby/2.7.0/net/protocol.rb:217:in `rbuf_fill' /usr/local/lib/ruby/2.7.0/net/protocol.rb:159:in `read' /usr/local/lib/ruby/2.7.0/net/ftp.rb:1475:in `read' /usr/local/lib/ruby/2.7.0/net/ftp.rb:693:in `block (2 levels) in storbinary' /usr/local/lib/ruby/2.7.0/net/ftp.rb:308:in `with_binary' /usr/local/lib/ruby/2.7.0/net/ftp.rb:684:in `block in storbinary' /usr/local/lib/ruby/2.7.0/monitor.rb:202:in `synchronize' /usr/local/lib/ruby/2.7.0/monitor.rb:202:in `mon_synchronize' /usr/local/lib/ruby/2.7.0/net/ftp.rb:683:in `storbinary' /usr/local/lib/ruby/2.7.0/net/ftp.rb:843:in `putbinaryfile' /usr/local/lib/ruby/2.7.0/net/ftp.rb:871:in `put' ``` -- https://bugs.ruby-lang.org/