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

Deadlock in `block in all_done' / @threads.size.times{ @done.pop } #28

Open
m-o-e opened this issue Feb 25, 2015 · 0 comments
Open

Deadlock in `block in all_done' / @threads.size.times{ @done.pop } #28

m-o-e opened this issue Feb 25, 2015 · 0 comments

Comments

@m-o-e
Copy link

m-o-e commented Feb 25, 2015

Hi,

we're seeing a deadlock, possibly related to #26.

Our resque workers invoke Open4::spawn like so:

status = Open4::spawn argv, {'quiet' => true, 'raise' => true, 'stdin' => stdin, 'stdout' => stdout, 'stderr' => stderr}

argv is a relatively long lived process (5-10 minutes) which
we see sometimes (rarely) fail with a deadlock:

deadlock detected (fatal)
1.9.3-p551/lib/ruby/1.9.1/thread.rb:189:in `sleep'
1.9.3-p551/lib/ruby/1.9.1/thread.rb:189:in `block in pop'
<internal:prelude>:10:in `synchronize'
1.9.3-p551/lib/ruby/1.9.1/thread.rb:184:in `pop'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:206:in `block in all_done'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:206:in `times'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:206:in `all_done'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:199:in `run'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:358:in `block (3 levels) in spawn'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:111:in `call'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:111:in `do_popen'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:46:in `popen4ext'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:336:in `block (2 levels) in spawn'
1.9.3-p551/lib/ruby/1.9.1/timeout.rb:55:in `timeout'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:335:in `block in spawn'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:374:in `call'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:374:in `chdir'
1.9.3-p551/lib/ruby/gems/1.9.1/gems/open4-1.3.4/lib/open4.rb:334:in `spawn'

Any ideas?

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

No branches or pull requests

1 participant