grosser / parallel

Ruby: parallel processing made simple and fast
MIT License
4.16k stars 254 forks source link

Parallel::UndumpableException: OpenSSL::SSL::SSLError: SSL_read: decryption failed or bad record mac #291

Open arunkarthick opened 3 years ago

arunkarthick commented 3 years ago

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 commented 3 years ago
gdotdesign commented 3 years ago

We have run into this issue too:

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 commented 3 years ago

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

gdotdesign commented 3 years ago

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 commented 3 years ago