199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
|
# File 'lib/cosmos/operators/operator.rb', line 199
def respawn_dead
@mutex.synchronize do
@processes.each do |name, p|
break if @shutdown
unless p.alive?
p.stdout.rewind
output = p.stdout.read
p.stdout.close
p.stdout.unlink
p.stderr.rewind
err_output = p.stderr.read
p.stderr.close
p.stderr.unlink
Logger.error("Unexpected process died... respawning! #{p.process_definition.join(' ')}\nStdout:\n#{output}\nStderr:\n#{err_output}\n", scope: p.scope)
p.start
end
end
end
end
|