Forum: Ruby DRb freezes YARV?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Meinrad R. (Guest)
on 2007-03-07 23:49
(Received via mailing list)
dear all,

Has anyone tried out drb on latest ruby1.9 including VM? Well, I tried
out drb and found that DRb#start_service won't return on YARV as it
does on Ruby1.8. It is so strange that I can not find a reasonable
explanation for the behaviour.

Let me explain what I found out by (manually) tracing the threads of
execution in drb:

The main thread enters DRbServer#initialize and enters DRbServer#run.
In run a new thread (the main_loop of the DRBServer) is startet that
runs concurrently until it blocks in Socket#accept. The strange thing
is, that exactly after the main_loop thread begins to block the main
thread won't run any further! Right before the end of
DRbServer#initialize it stops and does not jump out though there is
nothing left to do.

Next thing I tried is replacing the Socket#accept by something else. I
replaced it by a sleep( 5). With this the main thread is able to jump
out of DRbServer#initialize ... suggesting that the bug lies in
Socket#accept. However I made up a simple test script with a socket
and put the line socket.accept in a thread. This test script runs as
it should on both yarv and on 1.8.5 without blocking the main thread.

I'm sorry, that I was not yet able to reproduce the freeze in a
minimal test script.

I'd say it smells like a deadlock but I am definitely not a threading
expert and I don't know much about Sockets and the internals of YARV
so I leave the interpretation of the facts to the experts among you.

cheers,
-- henon
Meinrad R. (Guest)
on 2007-03-08 14:21
(Received via mailing list)
dear all,

(This post did not get any replies at ruby-talk so maybe it is better
posted here.)

Has anyone tried out drb on latest ruby1.9 including VM? Well, I tried
out drb and found that DRb#start_service won't return on YARV as it
does on Ruby1.8. It is so strange that I can not find a reasonable
explanation for the behaviour.

Let me explain what I found out by (manually) tracing the threads of
execution in drb:

The main thread enters DRbServer#initialize and enters DRbServer#run.
In run a new thread (the main_loop of the DRBServer) is startet that
runs concurrently until it blocks in Socket#accept. The strange thing
is, that exactly after the main_loop thread begins to block the main
thread won't run any further! Right before the end of
DRbServer#initialize it stops and does not jump out though there is
nothing left to do.

Next thing I tried is replacing the Socket#accept by something else. I
replaced it by a sleep( 5). With this the main thread is able to jump
out of DRbServer#initialize ... suggesting that the bug lies in
Socket#accept. However I made up a simple test script with a socket
and put the line socket.accept in a thread. This test script runs as
it should on both yarv and on 1.8.5 without blocking the main thread.

I'm sorry, that I was not yet able to reproduce the freeze in a
minimal test script.

I'd say it smells like a deadlock but I am definitely not a threading
expert and I don't know much about Sockets and the internals of YARV
so I leave the interpretation of the facts to the experts among you,
while I look into it a bit more .... but any hints what might be the
issue would help me very much!

cheers,
-- henon
Meinrad R. (Guest)
on 2007-03-12 19:39
(Received via mailing list)
shall i file a bug on rubyforge? why is there no reply of any kind? is
this not the right place to post? I feel a bit ignored  ...

regards,
--henon
Yukihiro M. (Guest)
on 2007-03-12 20:09
(Received via mailing list)
Hi,

In message "Re: DRb freezes YARV?"
    on Tue, 13 Mar 2007 02:38:09 +0900, "Meinrad R."
<removed_email_address@domain.invalid> writes:

|shall i file a bug on rubyforge? why is there no reply of any kind? is
|this not the right place to post? I feel a bit ignored  ...

I'm sorry, we saw the report.  I think it would take bit longer to
identify and fix the problem.

              matz.
This topic is locked and can not be replied to.