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::UndumpableException: OpenSSL::SSL::SSLError: SSL_read: decryption failed or bad record mac #291

Open
arunkarthick opened this issue Feb 19, 2021 · 5 comments

Comments

@arunkarthick
Copy link

Hello,

We are getting Openssl related errors when we try to use 'parallel' gem for our time consuming process.

time = Benchmark.realtime do
  results = Parallel.map(collection, in_processes: 16) do |entity|
     result = time_consuming_rest_api_response_for(entity)
  end
end
Logger.info "time_consuming_rest_api_response took #{time.round(3)} seconds"
results.flatten

When we run the above script, its running fine and then after some time, its throwing the below error and exit.

Parallel::UndumpableException: OpenSSL::SSL::SSLError: SSL_read: decryption failed or bad record mac
from /Users/dev/.rbenv/versions/2.5.3/lib/ruby/2.5.0/openssl/buffering.rb:57:in `sysread'

Any thoughts?

@grosser
Copy link
Owner

grosser commented Feb 20, 2021

  • run with in_processes: 0 to check it works on it's own
  • run with in_processes: 1 to check it works when not in parallel
  • run with in_threads: 2 to check if it's a forking issue
    otherwise idk how to debug this :/

@gdotdesign
Copy link

We have run into this issue too:

  • in_processes: 0 runs fine
  • in_processes: 2 we get this error (ActiveRecord with Rails 4.2.7)
ActiveRecord::StatementInvalid: PG::UnableToSend: SSL error: sslv3 alert bad record mac : 

Hope it helps, we disabled parallel execution for now, let me know if there is anything else I can provide.

@grosser
Copy link
Owner

grosser commented Sep 3, 2021

and you are using a different connection in each parallel process ? (reconnected ?)

@gdotdesign
Copy link

and you are using a different connection in each parallel process ? (reconnected ?)

Not that I know of, are you saying that this is basically a disconnect and I should try the approaches in the readme? (https://github.com/grosser/parallel#activerecord)

@grosser
Copy link
Owner

grosser commented Sep 3, 2021

  • try the approaches in the readme
  • try diconnecting before going into parallel

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

3 participants