You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use AWS Spot Instances as CI nodes, ensure that the termination signal is properly propagated down the script hierarchy.
85
+
84
86
```bash
85
87
#!/bin/bash
86
88
89
+
handle_signal() {
90
+
local signal=$1
91
+
if [[ -n$knapsack_pro_pid ]];then
92
+
echo"KNAPSACK_PRO_CI_NODE_INDEX=$KNAPSACK_PRO_CI_NODE_INDEX Received signal $signal in bin/parallel_tests, terminating the Knapsack Pro process with TERM"
93
+
kill -TERM $knapsack_pro_pid
94
+
echo"KNAPSACK_PRO_CI_NODE_INDEX=$KNAPSACK_PRO_CI_NODE_INDEX Waiting for the Knapsack Pro process with PID $knapsack_pro_pid to terminate"
95
+
wait$knapsack_pro_pid
96
+
fi
97
+
}
98
+
99
+
trap'handle_signal TERM' TERM
100
+
trap'handle_signal INT' INT
101
+
87
102
# The Knapsack Pro API sees 3 * 2 = 6 parallel nodes
0 commit comments