mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
zed: allow limiting concurrent jobs
200ms time-out is relatively long, but if we already hit the cap, then we'll likely be able to spawn multiple new jobs when we wake up Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #11807
This commit is contained in:
@@ -3705,8 +3705,8 @@ function zed_start
|
||||
# run ZED in the background and redirect foreground logging
|
||||
# output to $ZED_LOG.
|
||||
log_must truncate -s 0 $ZED_DEBUG_LOG
|
||||
log_must eval "zed -vF -d $ZEDLET_DIR -p $ZEDLET_DIR/zed.pid -P $PATH" \
|
||||
"-s $ZEDLET_DIR/state 2>$ZED_LOG &"
|
||||
log_must eval "zed -vF -d $ZEDLET_DIR -P $PATH" \
|
||||
"-s $ZEDLET_DIR/state -j 1 2>$ZED_LOG &"
|
||||
fi
|
||||
|
||||
return 0
|
||||
@@ -3722,14 +3722,13 @@ function zed_stop
|
||||
fi
|
||||
|
||||
log_note "Stopping ZED"
|
||||
if [[ -f ${ZEDLET_DIR}/zed.pid ]]; then
|
||||
zedpid=$(<${ZEDLET_DIR}/zed.pid)
|
||||
kill $zedpid
|
||||
while ps -p $zedpid > /dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
rm -f ${ZEDLET_DIR}/zed.pid
|
||||
fi
|
||||
while true; do
|
||||
zedpids="$(pgrep -x zed)"
|
||||
[ "$?" -ne 0 ] && break
|
||||
|
||||
log_must kill $zedpids
|
||||
sleep 1
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ log_assert "Verify zpool sub-commands generate expected events"
|
||||
log_onexit cleanup
|
||||
|
||||
log_must zpool events -c
|
||||
log_must zed_stop
|
||||
log_must zed_start
|
||||
|
||||
# Backup our zed.rc
|
||||
|
||||
Reference in New Issue
Block a user