From 96c872ac37578f8e48087b1a8f6f0bd6c27ac433 Mon Sep 17 00:00:00 2001 From: Emil Tin Date: Sat, 15 Dec 2012 12:30:52 +0100 Subject: [PATCH] prevent hang trying to shut down zombie processes --- Rakefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Rakefile b/Rakefile index 6b09d01f1..727412797 100644 --- a/Rakefile +++ b/Rakefile @@ -6,6 +6,7 @@ require 'sys/proctable' DATA_FOLDER = 'sandbox' PROFILE = 'bicycle' +OSRM_PORT = 5000 Cucumber::Rake::Task.new do |t| t.cucumber_opts = %w{--format pretty} @@ -32,7 +33,7 @@ task osm_data_area_name.to_sym {} #define empty task to prevent rake from whin def each_process name, &block Sys::ProcTable.ps do |process| - if process.comm.strip == name.strip + if process.comm.strip == name.strip && process.state != 'zombie' yield process.pid.to_i, process.state.strip end end @@ -60,7 +61,7 @@ def write_server_ini osm_file s=<<-EOF Threads = 1 IP = 0.0.0.0 - Port = 5000 + Port = #{OSRM_PORT} hsgrData=#{osm_file}.osrm.hsgr nodesData=#{osm_file}.osrm.nodes @@ -151,7 +152,7 @@ task :up => :setup do timeout = 5 (timeout*10).times do begin - socket = TCPSocket.new('localhost', 5000) + socket = TCPSocket.new('localhost', OSRM_PORT) socket.puts 'ping' rescue Errno::ECONNREFUSED sleep 0.1