-
Notifications
You must be signed in to change notification settings - Fork 255
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::DeadWorker #122
Comments
the error you are getting means it blows up when trying to send the postgress results from 1 process to the other, can you just use |
I used in_threads=> instead and it seemed to work. I think it might have something to do with the writing of the CSV file. When I use in_processes there is a permissions problem with the file (file.is_closed() = false). But with threading it seems to be that the file itself is more globally protected and is let go of when not being used. Does that make sense or am I way off? |
do you open the file before Parallel.map ? -> the forked processes might On Wed, Feb 18, 2015 at 8:30 AM, Kevin Truckenmiller <
|
No iit downloads the file, creates a new one based off of that file, then should save it. This all happens within the map. Since its downloading up to 80 files or so I thought by doing a bunch at a time would be nice and speed things up |
and the files are all stored in a different location / no overwriting each On Wed, Feb 18, 2015 at 9:18 AM, Kevin Truckenmiller <
|
They don't overwrite each other, but they are stored in the same director. I append a different filename and then delete the downloaded file after the creation of the new .csv |
can you reproduce the error with fork { ... inner code ... } ? On Wed, Feb 18, 2015 at 9:51 AM, Kevin Truckenmiller <
|
Inner code:
ERROR:63 We downloaded this one ActiveRecord::StatementInvalid (PG::ConnectionBad: PQconsumeInput() server closed the connection unexpectedly Rendered /Users/kmtruckenmiller/.rvm/gems/ruby-2.0.0-p598/gems/actionpack-4.0.13/lib/action_dispatch/middleware/templates/rescues/_source.erb (0.6ms) |
hmm maybe keep the marking as downloaded outside of the threads, just On Thu, Feb 19, 2015 at 11:51 AM, Kevin Truckenmiller <
|
Sorry my delay... but i had some problem! And this erros is caused because the worker is waiting an answer. Always put a return at the end. The last code above "puts ..." works like return. |
Hi Everyone! I'm super new to ruby but I've found Parallel very helpful to what I'm doing. I'm trying to put some CSV files into my postgresql db and I'm running into an error. I download the csv and then manipulate them - then try to put them into postgres... I'm having that reconnect error but I'm not sure how to fix it in my code. If I move processes to 0 it works just fine. But if I'm going to be downloading multiple files it would be great to have it all done in parallel. :) Any ideas or is there something glaring that I'm just too much of a newbie for? another idea would be to do the downloads first and then run the copy_from csv to postgres without parallel.
Here's the error I get.
/Users/kmtruckenmiller/.rvm/gems/ruby-2.0.0-p598/gems/parallel-1.3.4/lib/parallel.rb:340:in `dump': no _dump_data is defined for class PG::Result (TypeError)
The text was updated successfully, but these errors were encountered: