prevent hang trying to shut down zombie processes
This commit is contained in:
parent
51f67f3fa0
commit
96c872ac37
7
Rakefile
7
Rakefile
@ -6,6 +6,7 @@ require 'sys/proctable'
|
|||||||
|
|
||||||
DATA_FOLDER = 'sandbox'
|
DATA_FOLDER = 'sandbox'
|
||||||
PROFILE = 'bicycle'
|
PROFILE = 'bicycle'
|
||||||
|
OSRM_PORT = 5000
|
||||||
|
|
||||||
Cucumber::Rake::Task.new do |t|
|
Cucumber::Rake::Task.new do |t|
|
||||||
t.cucumber_opts = %w{--format pretty}
|
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
|
def each_process name, &block
|
||||||
Sys::ProcTable.ps do |process|
|
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
|
yield process.pid.to_i, process.state.strip
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -60,7 +61,7 @@ def write_server_ini osm_file
|
|||||||
s=<<-EOF
|
s=<<-EOF
|
||||||
Threads = 1
|
Threads = 1
|
||||||
IP = 0.0.0.0
|
IP = 0.0.0.0
|
||||||
Port = 5000
|
Port = #{OSRM_PORT}
|
||||||
|
|
||||||
hsgrData=#{osm_file}.osrm.hsgr
|
hsgrData=#{osm_file}.osrm.hsgr
|
||||||
nodesData=#{osm_file}.osrm.nodes
|
nodesData=#{osm_file}.osrm.nodes
|
||||||
@ -151,7 +152,7 @@ task :up => :setup do
|
|||||||
timeout = 5
|
timeout = 5
|
||||||
(timeout*10).times do
|
(timeout*10).times do
|
||||||
begin
|
begin
|
||||||
socket = TCPSocket.new('localhost', 5000)
|
socket = TCPSocket.new('localhost', OSRM_PORT)
|
||||||
socket.puts 'ping'
|
socket.puts 'ping'
|
||||||
rescue Errno::ECONNREFUSED
|
rescue Errno::ECONNREFUSED
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
Loading…
Reference in New Issue
Block a user