F
Farrel Lifson
------=_Part_212249_10342094.1177845441000
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi all,
I'm busy experimenting with DRb and I've hit some strange behaviour
which I can't get seem to find the cause of. I think it might be
something to do with DRb and forks but I'm unsure. The process I'm
trying to achieve is to have a Server process running as a DRb
service. It can spawn client processes (the create_client method)
which also run using a DRb service.
Upon spawning the clients create DRb proxy objects to the server and
register using the register_client method passing through their client
process pid and url. The server then creates DRb proxy objects with
the information it receives and stores it in a hash with the client
pid as the key. We can retrieve an array of client pid using the
client_pids method on the server.
I have encountered the following problem. When I start the server
process and then start the client process independent from the server
process everything seems to work fine. I can retrieve from the server
the array of client pids and everything exits gracefully.
However when I create the client from within the server process using
the create_client method (like it hopefully would normally do) the
server registers the client pid and stores it in the hash but on
subsequent calls to get the array of pids it comes back empty(!) and a
ruby process hangs around afterwards. I've attached some files showing
this behaviour. Both tests in theory should be doing the same thing;
registering a client with a server and then retrieving the array of
client pids.
farrel@nicodemus ~/Desktop $ ruby server.rb -n test_register_client
Loaded suite server
Started
Registered client druby://localhost:41362, 1 clients registered
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi all,
I'm busy experimenting with DRb and I've hit some strange behaviour
which I can't get seem to find the cause of. I think it might be
something to do with DRb and forks but I'm unsure. The process I'm
trying to achieve is to have a Server process running as a DRb
service. It can spawn client processes (the create_client method)
which also run using a DRb service.
Upon spawning the clients create DRb proxy objects to the server and
register using the register_client method passing through their client
process pid and url. The server then creates DRb proxy objects with
the information it receives and stores it in a hash with the client
pid as the key. We can retrieve an array of client pid using the
client_pids method on the server.
I have encountered the following problem. When I start the server
process and then start the client process independent from the server
process everything seems to work fine. I can retrieve from the server
the array of client pids and everything exits gracefully.
However when I create the client from within the server process using
the create_client method (like it hopefully would normally do) the
server registers the client pid and stores it in the hash but on
subsequent calls to get the array of pids it comes back empty(!) and a
ruby process hangs around afterwards. I've attached some files showing
this behaviour. Both tests in theory should be doing the same thing;
registering a client with a server and then retrieving the array of
client pids.
farrel@nicodemus ~/Desktop $ ruby server.rb -n test_register_client
Loaded suite server
Started
Registered client druby://localhost:41362, 1 clients registered