Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel extract many files: Invalid file format (indefinite bug) #15

Open
georgy7 opened this issue Apr 12, 2015 · 1 comment
Open

Comments

@georgy7
Copy link

georgy7 commented Apr 12, 2015

I use Webrick with seven_zip_ruby to open archieved items right in browser.
Almost all files extract well, but a few cause 500 HTTP code on Webrick.
When I open these files separately in browser, they are opened.
The count of badly opened files less if I do sleep rand in the servlet.

[2015-04-12 22:10:06] ERROR StandardError: Invalid file format. extract
        C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/seven_zip_ruby-1.2.4-x64-mingw32/lib/seven_zip_ruby/seven_zip_reader.rb:454:in `extract_impl'
        C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/seven_zip_ruby-1.2.4-x64-mingw32/lib/seven_zip_ruby/seven_zip_reader.rb:454:in `block in extract_data'
        C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/seven_zip_ruby-1.2.4-x64-mingw32/lib/seven_zip_ruby/seven_zip_reader.rb:524:in `block in synchronize'
        C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/seven_zip_ruby-1.2.4-x64-mingw32/lib/seven_zip_ruby/seven_zip_reader.rb:523:in `synchronize'
        C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/seven_zip_ruby-1.2.4-x64-mingw32/lib/seven_zip_ruby/seven_zip_reader.rb:523:in `synchronize'
        C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/seven_zip_ruby-1.2.4-x64-mingw32/lib/seven_zip_ruby/seven_zip_reader.rb:453:in `extract_data'
@georgy7
Copy link
Author

georgy7 commented Apr 12, 2015

def gete(entry, tries = 60)
  begin
    return @reader.extract_data(entry)
  rescue
    return nil if tries <= 0
    sleep 1 + 1 * rand
    return gete entry, tries - 1
  end
end

But I think, it just hides symptoms of the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant