[#80531] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...>

SASADA Koichi <ko1@ruby-lang.org> wrote:

24 messages 2017/04/02
[#80532] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/04/02

On 2017/04/02 11:35, Eric Wong wrote:

[#80540] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/04/03

SASADA Koichi <ko1@atdot.net> wrote:

[#81027] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/05/08

Eric Wong <normalperson@yhbt.net> wrote:

[#81028] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/05/08

On 2017/05/08 9:33, Eric Wong wrote:

[#81029] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/05/08

On 2017/05/08 10:53, SASADA Koichi wrote:

[#81031] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/05/08

SASADA Koichi <ko1@atdot.net> wrote:

[#81033] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/05/08

On 2017/05/08 12:01, Eric Wong wrote:

[#81035] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/05/08

SASADA Koichi <ko1@atdot.net> wrote:

[#81042] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/05/09

On 2017/05/08 15:36, Eric Wong wrote:

[#81044] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/05/09

SASADA Koichi <ko1@atdot.net> wrote:

[#81045] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — SASADA Koichi <ko1@...> 2017/05/09

On 2017/05/09 12:38, Eric Wong wrote:

[#81047] Re: [ruby-cvs:65407] normal:r58236 (trunk): thread.c: comments on M:N threading [ci skip] — Eric Wong <normalperson@...> 2017/05/09

SASADA Koichi <ko1@atdot.net> wrote:

[ruby-core:80581] [Ruby trunk Bug#13141] Spurious Net::FTPReplyError

From: gavin@...
Date: 2017-04-05 17:57:16 UTC
List: ruby-core #80581
Issue #13141 has been updated by Phrogz (Gavin Kistner).


I see the same output in the logger and traceback, even with `debug_mode` set. Where should this output be seen?

~~~
D, [2017-04-05T10:41:09.572327 #8588] DEBUG -- : ...downloading developerdownloads_26549.esw3cdc_S.201703311500-1800-15.gz
C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:979:in `parse227': 226 Transfer complete. 0 bytes transferred. 0 bps. (Net::FTPReplyError)
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:392:in `makepasv'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:404:in `transfercmd'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:489:in `block (2 levels) in retrbinary'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:199:in `with_binary'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:487:in `block in retrbinary'
	from C:/Ruby/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:486:in `retrbinary'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:619:in `getbinaryfile'
	from import_from_ftp.rb:124:in `block (2 levels) in download_log_files'
~~~

----------------------------------------
Bug #13141: Spurious Net::FTPReplyError 
https://bugs.ruby-lang.org/issues/13141#change-64084

* Author: Phrogz (Gavin Kistner)
* Status: Assigned
* Priority: Normal
* Assignee: shugo (Shugo Maeda)
* Target version: 
* ruby -v: ruby 2.2.6p396 (2016-11-15 revision 56800) [x64-mingw32]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
I have a script that downloads many files via FTP. `ftp.getbinaryfile` occasionally fails (about 7 times while downloading ~2000 files).

Here's the code:

~~~ ruby
Net::FTP.open(SITE) do |ftp|
  ftp.login USER, PASS
  ftp.passive = true
  dates_by_year.each do |year,dates|
    ftp.chdir(File.join(DIR,'_archive',year.to_s))
    regex = /\.#{Regexp.union *dates.map(&mashed_date)}/
    ftp.list.map(&FILENAMEFROMLIST).compact.grep(regex).sort.map do |file|
      unzipped = calculate_uncompressed(file)
      unless File.exists?(unzipped)
        $log.debug "...downloading archived #{file}"
        ftp.getbinaryfile(file)
        $log.debug "...unzipping local #{file}"
        `gzip.exe -d #{file}`
        $log.debug "...unzipped #{file}"
      end
    end
  end
end
~~~

Here's an excerpt from the logs when it fails (where line 166 is the `getbinaryfile` call above):

~~~
D, [2017-01-19T16:08:48.307731 #1828] DEBUG -- : ...downloading archived developerdownloads_26549.esw3cdc_S.201611041500-1800-98.gz
D, [2017-01-19T16:08:49.350458 #1828] DEBUG -- : ...unzipping local developerdownloads_26549.esw3cdc_S.201611041500-1800-98.gz
D, [2017-01-19T16:08:49.412917 #1828] DEBUG -- : ...unzipped developerdownloads_26549.esw3cdc_S.201611041500-1800-98.gz
D, [2017-01-19T16:08:49.412917 #1828] DEBUG -- : ...downloading archived developerdownloads_26549.esw3cdc_S.201611041500-1800-99.gz
C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:979:in `parse227': 226 Transfer complete. 0 bytes transferred. 0 bps. (Net::FTPReplyError)
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:392:in `makepasv'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:404:in `transfercmd'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:489:in `block (2 levels) in retrbinary'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:199:in `with_binary'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:487:in `block in retrbinary'
	from C:/Ruby/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:486:in `retrbinary'
	from C:/Ruby/lib/ruby/2.2.0/net/ftp.rb:619:in `getbinaryfile'
	from E:/dashstats_importer/import_from_ftp.rb:166:in `block (3 levels) in download_archives'
~~~

Every time it fails is the exact same error message: `ftp.rb:977:in 'parse227': 226 Transfer complete. 0 bytes transferred. 0 bps. (Net::FTPReplyError)`.

When I run the script again the download succeeds, and eventually fails on a different file. It is not a problem with the specific files.

This is on `ruby 2.2.6p396 (2016-11-15 revision 56800) [x64-mingw32]` running under Windows Server R2012 R2, 64-bit



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next