We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2f82f39 commit cae4c41Copy full SHA for cae4c41
1 file changed
package/instance-manager-v2-prestop
@@ -24,6 +24,26 @@ function cleanup_spdk_resources() {
24
else
25
log "Successfully sent SIGTERM to go-spdk-helper"
26
fi
27
+
28
+ local grace_period=60
29
+ local elapsed=0
30
+ while [[ $elapsed -lt $grace_period ]]; do
31
+ if ! pgrep -f "^spdk_tgt" > /dev/null 2>&1; then
32
+ log "spdk_tgt process has stopped"
33
+ return
34
+ fi
35
+ sleep 1
36
+ elapsed=$((elapsed + 1))
37
+ log "Waiting for spdk_tgt to stop... (${elapsed}/${grace_period}s)"
38
+ done
39
40
+ log "spdk_tgt did not stop within ${grace_period}s grace period, sending SIGKILL..."
41
+ pkill -KILL -f "^spdk_tgt"
42
+ if [[ $? -eq 0 ]]; then
43
+ log "Successfully sent SIGKILL to spdk_tgt"
44
+ else
45
+ log "Failed to send SIGKILL to spdk_tgt (process may have already exited)"
46
47
}
48
49
function get_v2_devices() {
0 commit comments