mirror of
https://github.com/openstf/stf
synced 2025-10-04 10:19:30 +02:00
Detect if we kill device worker before it becomes operational.
This commit is contained in:
parent
f056e0d2ca
commit
a4725fe71c
1 changed files with 20 additions and 14 deletions
|
@ -86,10 +86,15 @@ module.exports = function(options) {
|
|||
proc.on('exit', function(code, signal) {
|
||||
var data = workers[device.id]
|
||||
delete workers[device.id]
|
||||
if (code === 0) {
|
||||
switch (code) {
|
||||
case 0:
|
||||
log.info('Device worker "%s" stopped cleanly', device.id)
|
||||
}
|
||||
else {
|
||||
break
|
||||
case 143: // SIGTERM
|
||||
log.warn('Device worker "%s" was killed before becoming operational'
|
||||
, device.id)
|
||||
break
|
||||
default:
|
||||
log.error('Device worker "%s" had a dirty exit (code %d)',
|
||||
device.id, code)
|
||||
if (Date.now() - data.started < 10000) {
|
||||
|
@ -100,6 +105,7 @@ module.exports = function(options) {
|
|||
log.info('Restarting worker of "%s"', device.id)
|
||||
maybeConnect(device)
|
||||
}
|
||||
break
|
||||
}
|
||||
})
|
||||
workers[device.id] = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue