fix: max_run_time setting in cib
The cib configuration setting max_run_time didn’t always work, because its implementation only killed the adapter, not any child processes of the adapter. We fix this by running the adapter in its own process group, and killing the whole group if the time runs out.
In addition, the timeoutcmd.rs module (and the ChildProcess type) is simplified, by making the deadline mandatory. It is no longer possible to run an adapter without a timeout. This makes sense, as it’d not be useful to allow an adapter to run indefinitely. The old behavior can be simulated by setting a very long timeout, such as a year.
Signed-off-by: Lars Wirzenius liw@liw.fi
3 files changed
+42
-35
b3898f65
→
27317200
modified Cargo.lock
@@ -1383,9 +1383,9 @@ dependencies = [
|
|
|
|
|
|
| - | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|
@@ -1994,6 +1994,7 @@ dependencies = [
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified Cargo.toml
@@ -15,6 +15,7 @@ anyhow = "1.0.95"
|
|
|
|
|
|
| + | |
|
|
|
|
|
modified src/timeoutcmd.rs
@@ -53,12 +53,15 @@ use std::{
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
|
|
|
|
|
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -154,7 +157,7 @@ impl FinishedProcess {
|
|
|
|
|
|
| - | |
| + | |
|
|
|
|
|
@@ -189,6 +192,7 @@ impl ChildProcess {
|
|
|
|
|
|
| + | |
|
|
|
|
|
@@ -230,11 +234,10 @@ impl ChildProcess {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
|
@@ -246,9 +249,15 @@ impl ChildProcess {
|
|
|
|
|
|
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
| - | |
|
|
|
|
|
@@ -271,18 +280,17 @@ impl ChildProcess {
|
|
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
| - | |
| + | |
|
|
|
|
|
@@ -431,25 +439,23 @@ impl RealtimeLines {
|
|
|
|
|
|
| - | |
|
|
| - | |
| - | |
| - | |
| + | |
| + | |
| + | |
| + | |
| + | |
| + | |
|
|
|
|
| - | |
| - | |
| - | |
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
|
|
|
|
| - | |
|
|
|
|
|
@@ -457,13 +463,12 @@ impl RealtimeLines {
|
|
|
|
|
|
| - | |
| - | |
| + | |
| + | |
|
|
|
|
|
|
|
|
| - | |
|
|
|
|
|