parallel: PG Error: PG::UnableToSend
workmaster2n/parallel@1d5eae391137d1fb58a5334a844734e480b8ca15
When I run
bundle exec ruby spec/cases/map_with_ar_postges.rb
I get back:
making user
making user
making user
making user
making user
making user
making user
making user
/Users/tyler/.rvm/gems/ruby-1.9.3-p392@parallel/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:512:in `exec': server closed the connection unexpectedly (PG::UnableToSend)
This probably means the server terminated abnormally
before or while processing the request.
from /Users/tyler/.rvm/gems/ruby-1.9.3-p392@parallel/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:512:in `dealloc'
from /Users/tyler/.rvm/gems/ruby-1.9.3-p392@parallel/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:495:in `block in clear'
from /Users/tyler/.rvm/gems/ruby-1.9.3-p392@parallel/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:494:in `each_value'
from /Users/tyler/.rvm/gems/ruby-1.9.3-p392@parallel/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:494:in `clear'
from /Users/tyler/.rvm/gems/ruby-1.9.3-p392@parallel/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:557:in `clear_cache!'
from /Users/tyler/.rvm/gems/ruby-1.9.3-p392@parallel/gems/activerecord-4.0.0/lib/active_record/connection_adapters/abstract_adapter.rb:322:in `reconnect!'
from /Users/tyler/.rvm/gems/ruby-1.9.3-p392@parallel/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:569:in `reconnect!'
from spec/cases/map_with_ar_postges.rb:39:in `block in <main>'
from /Users/tyler/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/tempfile.rb:320:in `open'
from spec/cases/map_with_ar_postges.rb:4:in `<main>'
It appears that something is going awry with postgres.
About this issue
- Original URL
- State: open
- Created 11 years ago
- Comments: 20 (15 by maintainers)
Given this, here’s the way I’ve dealt with using PSQL databases with multiple processes: (works perfectly)
Okay, I didn’t expect this:
I tried the last file, but with mysql instead, and it fails… Even though similar statements work just peachy in my full-stack Rails app. Maybe there’s another component at play.
mysql_ar_parallel_test.rb
Output:
Edit:
Workaround # 1 does work for this
I’ll try in Postgres this afternoon.