Hanging at end of chef-client run

Hi,

I have a recipe that as part of the run upgrades a running application. The
last step before ending is to spwan a process to restart the application and
then to detach from that process. 9 out 10 times every thing goes well. But
once in a while the whole chef-client run just hangs at the end with
everything done like this:

[2013-11-07T17:13:16+00:00] INFO: Chef Run complete in 14.577406 seconds

[2013-11-07T17:13:16+00:00] INFO: Running report handlers

[2013-11-07T17:13:16+00:00] INFO: Report handlers complete

And then I have to kill the process. I am running on windows. This is the
block of code I use:

pid = Process.spawn(command(@current_resource.version, SERVER, CONF),

                  :chdir => @current_resource.home,

                  :out => "#{node['svr']['logdir']

}\#{timestamp}-out.log",

                  :err => "#{node['svr']['logdir']

}\#{timestamp}-err.log"

)

Process.detach(pid)

Maybe this is more of a ruby question than a chef question. I should in
principle soon make my application into a service. But due to time
conctraints this is not an option at the moment.

Cheers,

Florian