td 0.10.70 → 0.10.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ == 2013-02-05 version 0.10.71
2
+
3
+ * bulk_import:upload_parts: improved retry algorithm to use exponential wait time
4
+ * bulk_import:upload_parts: improved error messages
5
+
6
+
1
7
  == 2013-01-25 version 0.10.70
2
8
 
3
9
  * Add status to job subcommand, td job:status job_id
@@ -33,7 +33,7 @@ You need to authorize the account, before executing any other commands.
33
33
 
34
34
  == Mac OS X
35
35
 
36
- Disable RVM and enable system ruby (/usr/bin/ruby) first.
36
+ Disable RVM or rbenv and use system ruby (/usr/bin/ruby).
37
37
  And then run following commands:
38
38
 
39
39
  $ sudo gem install bundler
@@ -162,12 +162,20 @@ module Command
162
162
 
163
163
  unless errors.empty?
164
164
  $stderr.puts "failed to upload #{errors.size} files."
165
+ $stderr.puts "backtraces:"
165
166
  errors.each {|(ifname,ex)|
166
167
  $stderr.puts " #{ifname}: #{ex}"
167
168
  ex.backtrace.each {|bt|
168
- $stderr.puts " #{ifname}: #{ex}"
169
+ $stderr.puts " #{ifname}: #{bt}"
169
170
  }
170
171
  }
172
+ $stderr.puts "files:"
173
+ ifnames = errors.map {|(ifname,ex)| ifname }
174
+ ifnames.each {|ifname|
175
+ $stderr.puts " #{ifname}"
176
+ }
177
+ $stderr.puts "You can retry uploading by following command:"
178
+ $stderr.puts "td bulk_import:upload_parts #{name} #{ifnames.map {|ifname| "'#{ifname}'" }.join(' ')}"
171
179
  exit 1
172
180
  end
173
181
 
@@ -495,14 +503,16 @@ module Command
495
503
 
496
504
  private
497
505
  def bulk_import_upload_impl(name, part_name, io, size, retry_limit, retry_wait)
506
+ retry_count = 0
498
507
  begin
499
508
  client = get_client
500
509
  client.bulk_import_upload_part(name, part_name, io, size)
501
510
  rescue
502
- if retry_limit > 0
503
- retry_limit -= 1
511
+ if retry_limit >= retry_count
512
+ retry_count += 1
504
513
  $stderr.write "#{$!}; retrying '#{part_name}'...\n"
505
- sleep retry_wait
514
+ w = (retry_count ** 1.5) * retry_wait
515
+ sleep w
506
516
  retry
507
517
  end
508
518
  raise
@@ -1,5 +1,5 @@
1
1
  module TreasureData
2
2
 
3
- VERSION = '0.10.70'
3
+ VERSION = '0.10.71'
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: td
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.70
4
+ version: 0.10.71
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-25 00:00:00.000000000 Z
12
+ date: 2013-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
@@ -236,18 +236,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
236
236
  - - ! '>='
237
237
  - !ruby/object:Gem::Version
238
238
  version: '0'
239
- segments:
240
- - 0
241
- hash: -3004606412038514569
242
239
  required_rubygems_version: !ruby/object:Gem::Requirement
243
240
  none: false
244
241
  requirements:
245
242
  - - ! '>='
246
243
  - !ruby/object:Gem::Version
247
244
  version: '0'
248
- segments:
249
- - 0
250
- hash: -3004606412038514569
251
245
  requirements: []
252
246
  rubyforge_project:
253
247
  rubygems_version: 1.8.23