similar to: postgres barfage revisted

Displaying 20 results from an estimated 3000 matches similar to: "postgres barfage revisted"

2006 Jul 12
1
When to use Mutex::synchronize?
I have a simple question when to the synchronize method in the Mutex class. Now that backgroundrb has allow_concurrency = true there is no need to synchronize database calls in threads. The question I have is lets say I have a simple method in my worker as follows: def some_method SomeModel.find_all each do |obj| obj.some_count += 1 obj.save! end end It accesses the database, but
2007 Mar 05
4
nil object / slave server problem
I''m just getting started wtih backgroundrb, and unfortunately hit a snag right away... I''m running the latest releases of rails, backgroundrb, slave and daemons. I created a simple worker class, using the generator, which currently does nothing but print the arguments that are passed to do_work. I''m running backgroundrb using ''./script/backgroundrb
2007 May 22
4
Recommendations for eternally-running backgroundrb workers?
I''ve got some workers that I want to have running all the time. Right now I''m just launching them manually, by requesting a special page in my rails app that includes lines like: MiddleMan.new_worker(:class=> :receiver, :job_key=>:r, :args=>{:sleep_time=>10}) This strikes me as a really weak way to fire up my workers. I basically want to automate things so
2007 Feb 07
2
ncluding backgroundrb issue
I have the next including files structure : - controller fileaA.rb including line (#8): require "fileB"... - /lib/fileB.rb with main header: load ''backgroundrb/worker.rb'' load ''backgroundrb/ worker_rails.rb'' class FileB <
2006 Aug 26
0
postgres-pr barfs at ActiveRecord::Base.allow_concurrency = true
Hi List, first of thank you Ezra for BackgroundRB. Very cool plugin indeed! This is a public service FYI. In case you are running postgres as your database backend and you are seeing the following errors in your backgroundrb.log: ActiveRecord::StatementInvalid: NoMethodError: undefined method `async_query'' for #<PGconn:0x22ed648>: You are using the postgres-pr adapter
2006 Jul 06
6
Mutex::Synchronize with backgroundrb
I have a question concerning where to use the synchronize function. The point of it is to put all of the code blacks passed to this function in a queue. This make sure that code gets ran one at a time. This is required when doing any kind of database activity in backgrondrb and multiple threads. Otherwise I lose the connection to my database. So here is my question: Do I need to do: @lock =
2007 Mar 13
5
worker starting twice
Hi gang, Thanks to other help I''ve gotten on this list, I''ve got backgroundrb up and running using postgres alongside my rails app. I''ve designed the system to have several eternally-running workers that periodically poll the database to see if there''s any work for them to do, and set things up in the config file to make them restart quickly if any of them
2006 Nov 20
4
Production RAILS_ENV / DB Selection
Hey all, I''m having some issues moving a project that incorporates Backgroundrb onto a staging server... For some reason (surely of my own doing), my RailsBase workers are insisting on using trying to access my development DB instead of my "production" DB. When I try to load a model object from within a worker, I get the following: 20061120-21:54:28 (26296)
2006 Aug 07
1
:load_rails
if CONFIG[''load_rails''] ActiveRecord::Base.allow_concurrency = true ActiveRecord::Base.establish_connection(YAML.load(ERB.new(IO.read ("#{RAILS_ROOT}/#{CONFIG[''database_yml'']}")).result)[CONFIG[''environment'']]) end if i read the code right, this option doesnt really load rails. wouldnt it be better (for those who rely on the
2007 Sep 03
11
MySQL has gone away
Hi, in a production environment we are running into "MySQL server has gone away" errors (see below) when we call rebuild_index in aaf. This happens sporadically. Any suggestions for what might be wrong or workarounds? I guess we try a reconnect before we call rebuild_index? Matthew ActiveRecord::StatementInvalid (Mysql::Error: MySQL server has gone away: SELECT count(*) AS
2006 Oct 24
1
Broken thread Safe connection Management on Mysql (Mysql too many connections errors)
Hi, There is an issue on socket connection with backgroundrb (rev 47) and mysql backend: after a certain number of job you reach the mysql connection limit as socket are never closed and nobody can connect to mysql anymore till you stop the backgroundrb daemon. Already reported on: http://rubyforge.org/pipermail/backgroundrb-devel/2006-July/000066.html,
2006 Aug 19
7
Impossible to get stable?
I have concluded that it is impossible to get this background process stable. I am out of ideas and could really use some help. Here is what I have: 50 workers, just running an infinite loop that constantly calls save! on a model. Keep in mind this is just for testing purposes. I catch all exceptions and put them in the log. I am tried setting allow_concurrency to true and false. Neither
2006 Jul 20
3
Mysql Server has gone away?
First off, amazing plugin! Being a rails noob, it helped me do some stuff I would''ve thought way over my head. Which brings me to my problem. :) I''m using backgroundrb to handle some processes that take so long that I don''t want them tied to a page refresh (several xml-rpc calls and saving data in text files on the server). I got it working with backgroundrb fairly
2006 Aug 17
1
Worker pool worker for page scanners: lost connection to mysql
Hello, I want to scan many URLs simultaneously with a new scanner worker for each URL, but I keep getting Mysql::Error: Lost connection to MySQL. Yes, allow_concurrency=false. Each scanner thread needs access to my ActiveRecord models to store discovered feeds and whatnot. There is a DB table called page_scans that acts as a big queue holding URLs waiting to be scanned. It would be
2007 Dec 28
9
lost connection 2.0
I lost my "connection lost" error.. but now I''ve got a "Mysql::Error: MySQL server has gone away" error.. It comes from: /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/connection_adapters/abstract_adapter.rb:128:in ''log''. I''m not sure if Rails / BackgroundRb uses it .. but i''ve got the mysql (2.7) gem
2006 Aug 18
1
Ezra....allow_concurrency = false?
In a previous email you wrote this: Glad you''re getting some use out of the plugin ;) ActiveRecord does have some issues with threading and concurrency that can sometimes cause that error you are seeing. Open up your script/backgroundrb/ start file and comment out the following line: ActiveRecord::Base.allow_concurrency = true Make sure you do that up in your main app script folder
2007 Feb 20
1
"Text is not a module"
Hello all, After upgrading to Rails 1.2.2, I''m getting a strange error when one of my workers is invoked. The worker is responsible for monitoring a folder (using directory_watcher) and emailing a specific user when a file is dropped there, but it''s bombing immediately upon instantiation (or maybe when trying to instantiate ActionMailer?) with the error "Text is not a
2007 Feb 05
3
Deploying to production with backgroundrb (capistrano)
I have noticed that occasionally (about 50% of the time) when i deploy (using capistrano) my app to a production server, i have to ssh into the box and manually stop and start backgroundrb to get it to load my workers. this is my basic setup i have 2 workers: lib/workers/mp3_worker.rb => takes a hash of params to downsample an mp3 lib/workers/flv_worker.rb => takes a has of
2007 Jul 05
6
Rails, background threads, ActiveRecord
Let''s start out without ActiveRecord, just to make the case. So, I have a calculation that will take a while to run in my Rails app. One doesn''t really want to just hold a HTTP connection open until it''s done, for a variety of obvious reasons. Even though everyone says "Rails isn''t thread safe", I can''t think of any reason this would be a
2006 Jul 31
1
MySQL too many connections?
Does any have any idea why I would get: Mysql::Error: Too many connections I am creating new threads in my background process. I know allow_concurrency is set to true. Does this create a new database connection when a new thread is created? Because what I''m doing is similar to this: @threads[model.id] = Thread.new do end I also kill off these threads and over write some of the