aws-sdk-ruby: aws-sdk-s3 upload fails with Deadlock

Issue description

When uploading a file, a deadlock is thrown by the multipart-upload method

[2] pry(main)> obj.upload_file(path)
fatal: No live threads left. Deadlock?
from /opt/chef/embedded/lib/ruby/gems/2.3.0/gems/aws-sdk-s3-1.12.0/lib/aws-sdk-s3/multipart_file_uploader.rb:145:in `value'

Gem name (‘aws-sdk’, ‘aws-sdk-resources’ or service gems like ‘aws-sdk-s3’) and its version

aws-sdk-core (3.20.2)
aws-sdk-kms (1.5.0)
aws-sdk-s3 (1.10.0)

Version of Ruby, OS environment

ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-linux-gnu]
centos 6.9

Code snippets / steps to reproduce

def upload_backup(path)
   s3 = Aws::S3::Resource.new(region: 'us-east-1')
   filename = File.basename(path)
   bucket = s3.bucket('myBackups')
   raise BackupAlreadyExistsOnS3, "file already exists in s3 #{filename}" if 
   bucket.object(filename).exists?
   obj = bucket.object(filename)
   puts "Beginning File Upload (#{filename})".light_blue
   obj.upload_file(path)
   puts "File Upload Successful (#{filename})".green
end

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

Okay, we’ve nailed this down exactly. #1545 predicted the possibility of certain file upload situations creating an endless loop in generating checksums, and that’s exactly what you’ve encountered. That pull request fixed this issue, and was released as aws-sdk-s3 version 1.16.0. If you upgrade, the problem will end.