mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
use new state STATE_STOPPING to trigger shutdown
This commit is contained in:
parent
836d8244d9
commit
e2c8859d79
4 changed files with 19 additions and 11 deletions
|
@ -370,10 +370,11 @@ retry: ret = io_scan(&f->io, smps, cnt);
|
|||
goto retry;
|
||||
|
||||
case FILE_EOF_STOP:
|
||||
info("Reached end-of-file. Stopping node %s", node_name(n));
|
||||
info("Reached end-of-file.");
|
||||
|
||||
killme(SIGTERM);
|
||||
pause();
|
||||
n->state = STATE_STOPPING;
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -136,8 +136,11 @@ int shmem_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned *re
|
|||
if (recv < 0) {
|
||||
/* This can only really mean that the other process has exited, so close
|
||||
* the interface to make sure the shared memory object is unlinked */
|
||||
shmem_int_close(&shm->intf);
|
||||
warning("Shared memory segment has been closed for node: %s", node_name(n));
|
||||
|
||||
info("Shared memory segment has been closed.");
|
||||
|
||||
n->state = STATE_STOPPING;
|
||||
|
||||
return recv;
|
||||
}
|
||||
|
||||
|
|
|
@ -264,9 +264,11 @@ int signal_generator_read(struct node *n, struct sample *smps[], unsigned cnt, u
|
|||
}
|
||||
|
||||
if (s->limit > 0 && s->counter >= s->limit) {
|
||||
info("Reached limit of node %s", node_name(n));
|
||||
killme(SIGTERM);
|
||||
return 0;
|
||||
info("Reached limit.");
|
||||
|
||||
n->state = STATE_STOPPING;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
s->counter += steps;
|
||||
|
|
|
@ -307,9 +307,11 @@ int test_rtt_read(struct node *n, struct sample *smps[], unsigned cnt, unsigned
|
|||
}
|
||||
|
||||
if (t->current >= vlist_length(&t->cases)) {
|
||||
info("This was the last case. Terminating.");
|
||||
killme(SIGTERM);
|
||||
pause();
|
||||
info("This was the last case. Stopping node %s", node_name(n));
|
||||
|
||||
n->state = STATE_STOPPING;
|
||||
|
||||
return -1;
|
||||
}
|
||||
else {
|
||||
struct test_rtt_case *c = (struct test_rtt_case *) vlist_at(&t->cases, t->current);
|
||||
|
|
Loading…
Add table
Reference in a new issue