meh / ruby-threadpool

A simple no-wasted-resources thread pool implementation.
21 stars 5 forks source link

Deadlock on #join. #2

Open meh opened 12 years ago

meh commented 12 years ago

Still no luck in solving this.

Upstream issue: https://bugs.ruby-lang.org/issues/6634

wamrewam commented 12 years ago

Hi Meh,

Sorry I have been quiet the last few days (I am traveling). I hit a bug in production (fairly heavy load). I am not sure what it is yet, I need to investigate further. I will report back as soon as I find out. I am posting it here but I am not sure it is related to #join actually.

PJ

ksmandersen commented 12 years ago

+1

I get this too. But it only occurs after there are no more jobs to process.

meh commented 12 years ago

I get this too. But it only occurs after there are no more jobs to process.

Well, that helps, I will investigate as soon as I finish this other thing I'm working on (within today).

meh commented 12 years ago

Apparently it's an MRI bug, it works on JRuby, I'll open a bug upstream, I'll keep this open until they fix it.

For both of you, I'd suggest either moving to Rubinius or to JRuby.

ksmandersen commented 12 years ago

Apparently it's an MRI bug, it works on JRuby, I'll open a bug upstream, I'll keep this open until they fix it.

For both of you, I'd suggest either moving to Rubinius or to JRuby.

That is odd. Neither is really an option for me atm. Could you link to the bug here once you post it? Thanks for all your help!

meh commented 12 years ago

Could you post the link to the bug once you post it?

I put it in the first comment.

we4tech commented 11 years ago

hi @meh

we4tech commented 11 years ago

hi @meh have you got any way around ? I've added the following code for getting rid of similar issue -

Thread.start do
  break until @pool.threads.select(&:alive?).size.zero?
end.join
sleep 1
meh commented 11 years ago

Sadly no, it's a bug in the deadlock inference in MRI, which isn't present on JRuby or Rubinius and I couldn't come up with a reduced test case to prove there's actually a bug, so it's been closed.

meh commented 11 years ago

Also threadpool has been deprecated, use the pool implementation in the thread gem.

we4tech commented 11 years ago

Thanks @meh :)