DRb Service Segfaults when stopping with Long running DRb Client

I have a long running DRb client (parent process) that starts and stops
DRb servers (child process) when requests come in via Process.spawn. I
am doing this so that there is a separate process available to service
requests when they come in (instead of separate threads). I am running
into a problem in that when I shut down the DRb service it segfaults.
This seems to be due to the fact that the client is still running. In
simple tests when I exit the client process before stopping the service,
no segfault. If I make sure the client is still there (for instance by
sleeping), segfault (in the service).
It appears that the DRb service (child process) still has several
threads running that are there to service DRb requests at the time I try
to shut the process down. I assume one of these wakes up and tries to
do some work while the process is in the midst of closing up shop,
causing the fault.

Any ideas anyone?

Thanks.

Can you provide a http://www.sscce.org/?

I’ll try but it won’t be easy (which may be related) or quick. The
running service uses FFI to bind to the VMware VixDiskLib - which is the
purpose of the process. So slimming down the service may take some
time. I’ll get back here with the smallest bit I can manage.
Thanks…

Jerry K. wrote in post #1147634:

I’ll try but it won’t be easy (which may be related) or quick. The
running service uses FFI to bind to the VMware VixDiskLib - which is the
purpose of the process.

That sounds like there are additional sources of the issue that were not
obvious from your initial posting. This is important information.

So slimming down the service may take some
time. I’ll get back here with the smallest bit I can manage.

An alternative approach would be to start from the other end (i.e. model
the basic scenario you have with parent, children and DRb) and see what
happens.

Robert K. wrote in post #1147639:

Jerry K. wrote in post #1147634:

I’ll try but it won’t be easy (which may be related) or quick. The
running service uses FFI to bind to the VMware VixDiskLib - which is the
purpose of the process.

That sounds like there are additional sources of the issue that were not
obvious from your initial posting. This is important information.

I agree that is a possibility. Its just bizarre that, without fail, if
I exit the parent process before the service finishes, the service shuts
down cleanly, and if, for instance, I do something as simple as putting
a sleep in the parent process so that it is still running when the
service exits, the service faults. I’m looking for something obvious
given this scenario but, obviously, it isn’t obvious. :slight_smile:

So slimming down the service may take some
time. I’ll get back here with the smallest bit I can manage.

An alternative approach would be to start from the other end (i.e. model
the basic scenario you have with parent, children and DRb) and see what
happens.

Right. Thanks again!

Ok I’ve determined that the VixDiskLib exit routine is causing this
issue. I’m not sure if it is really DRb related, or FFI related, or
just VixDiskLib related but obviously the exit routine is doing
something that isn’t playing nicely. For now I can simply eliminate
calling out to exit and the service shuts down cleanly. Since I really
am shutting down the service linked to VixDiskLib this seems to be at
least a temporary work-around.

Thanks for your help!

Jerry

Jerry K. wrote in post #1147640:

Robert K. wrote in post #1147639:

Jerry K. wrote in post #1147634:

I’ll try but it won’t be easy (which may be related) or quick. The
running service uses FFI to bind to the VMware VixDiskLib - which is the
purpose of the process.

That sounds like there are additional sources of the issue that were not
obvious from your initial posting. This is important information.

I agree that is a possibility. Its just bizarre that, without fail, if
I exit the parent process before the service finishes, the service shuts
down cleanly, and if, for instance, I do something as simple as putting
a sleep in the parent process so that it is still running when the
service exits, the service faults. I’m looking for something obvious
given this scenario but, obviously, it isn’t obvious. :slight_smile:

So slimming down the service may take some
time. I’ll get back here with the smallest bit I can manage.

An alternative approach would be to start from the other end (i.e. model
the basic scenario you have with parent, children and DRb) and see what
happens.

Right. Thanks again!