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

Beefed up Complex test method #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Beefed up Complex test method #49

wants to merge 2 commits into from

Conversation

pedz
Copy link

@pedz pedz commented Jun 19, 2011

I got my Rails processes (using thin) to wait until beanstalkd is running. The recipe I used is:

w.start_if do |start|
  start.condition(:complex) do |c|
    c.interval = 1.minute
    c.this(:process_running) do |p|
      p.running = false
    end
    c.and(:process_running) do |p|
      p.pid_file = $beanstalkd.pid_file
      p.running = true
    end
  end
end

The way I start beanstalkd is:

w.pid_file = w.pid_file
w.start = "/usr/local/bin/beanstalkd & echo $! > #{w.pid_file}"

If the start is slow (I added a sleep in front of it), the pid file doesn't exist and I was have problems with Complex throwing errors. I now catch the errors and assume the test is "false" in that case. It probably should chnage it so that nothing is thrown but this got me working.

If I start beanstalkd the recommended way of not setting the pid file I get some sort of hang due to locking issues. That may be a Ruby bug. I am using Ruby 1.9.1 p378. I'll do some more experimenting and see if I can strengthen it up a bit.

Is God dead? The google groups looks like a ghost town. Is there a new kid on the block? With the current level of documentation (basically the single front page), doing anything unusual (like using Complex) requires a lot of work. And the code is not well documented so it makes it hard. It kinda seems like someone's freshman project. I'm surprised so many people suggested I use it.

pedz added 2 commits June 18, 2011 19:50
On a strict compliant system, a child can not exit until all the data
from its pipes have been read.  We need to read the data before
waiting for the process to exit
@eric
Copy link
Collaborator

eric commented Jun 19, 2011

Lots of people are still using god. Most of the people who are using
it are still on 1.8, so I'm not sure of the state of the 1.9 support.

@leejarvis
Copy link

I'll be helping Eric and Tom to get up to date with Ruby 1.9. God is far from dead, it just needs lots of loving. Please remember though that Ruby 1.9.1 is a buggy release and has been known to randomly break applications. Any 1.9 compatible work made to God will be tested against 1.9.2

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

Successfully merging this pull request may close these issues.

None yet

3 participants