You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if this is actually a rack issue, but rack is the one complaining about this deadlock so I thought I'd start there. :)
I've got a Rails 3.1rc1 app that allows uploading of multiple files at once via a jQuery plugin called File Upload: http://aquantum-demo.appspot.com/file-upload This allows the user to upload a bunch of images which I then resize by farming out to ImageMagick's convert command and then upload to S3. My site is served by two Unicorn workers.
Last night I was uploading a batch of about 30 images at once. It looks like Chrome will do 6 simultaneously and it got through about half the batch before this started showing up in my unicorn.stderr.log:
The rest of my image uploads timed out and Unicorn restarted itself. I could upload again, but doing multiples at once kept causing this error (and much more frequently after the first time it happened--I could sometimes get it to deadlock when uploading two files at the same time).
Here's the gist of the flow of the app:
Client uploads a file
I take the tempfile created by Rack and set it as the file attribute of my Image model
modify is the method that farms out to ImageMagick with a command like convert -resize "250x250>" #{tempfile.path})
get_size calls identify #{tempfile.path} to get the dimensions of the image
upload sends the image up to S3
There are a few different places in there where things could go wrong (wrong image format for ImageMagick, S3 not responding) but in all of those cases shouldn't the request then throw an error or time out and then rack will release any locks?
The text was updated successfully, but these errors were encountered:
Yeah, I'm using 1.3.0. I've found that the ImageMagick command I'm running seems to freak out regularly and lock up so I'm going to switch over to freeimage. And I forgot all about Rainbows!, I'll switch over to that for my upload page, thanks!
Not sure if this is actually a rack issue, but rack is the one complaining about this deadlock so I thought I'd start there. :)
I've got a Rails 3.1rc1 app that allows uploading of multiple files at once via a jQuery plugin called File Upload: http://aquantum-demo.appspot.com/file-upload This allows the user to upload a bunch of images which I then resize by farming out to ImageMagick's convert command and then upload to S3. My site is served by two Unicorn workers.
Last night I was uploading a batch of about 30 images at once. It looks like Chrome will do 6 simultaneously and it got through about half the batch before this started showing up in my unicorn.stderr.log:
The rest of my image uploads timed out and Unicorn restarted itself. I could upload again, but doing multiples at once kept causing this error (and much more frequently after the first time it happened--I could sometimes get it to deadlock when uploading two files at the same time).
Here's the gist of the flow of the app:
Client uploads a file
I take the tempfile created by Rack and set it as the
file
attribute of my Image modelThen I do this:
tempfile = Tempfile.new(['prefix','.jpg'])
tempfile << File.read(self.file.tempfile)
modify(tempfile, options)
self.width, self.height = get_size(tempfile) if options[:save_dimensions]
upload(tempfile, options[:prefix]+remote_filename)
modify
is the method that farms out to ImageMagick with a command likeconvert -resize "250x250>" #{tempfile.path}
)get_size
callsidentify #{tempfile.path}
to get the dimensions of the imageupload
sends the image up to S3There are a few different places in there where things could go wrong (wrong image format for ImageMagick, S3 not responding) but in all of those cases shouldn't the request then throw an error or time out and then rack will release any locks?
The text was updated successfully, but these errors were encountered: