Skip to content

Commit

Permalink
zed: reap child after killing on time-out
Browse files Browse the repository at this point in the history
When a child process is killed waitpid() must be called on the
pid the reap the zombie process.

Update BUGS section to reflect reality by replacing "zedlets
aren't time limited with "zedlets can be interrupted".

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#11769 
Closes openzfs#11798
  • Loading branch information
nabijaczleweli authored Mar 26, 2021
1 parent 2b56a63 commit 38280c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions cmd/zed/zed_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ _zed_exec_fork_child(uint64_t eid, const char *dir, const char *prog,
zed_log_msg(LOG_WARNING, "Killing hung \"%s\" pid=%d",
prog, pid);
(void) kill(pid, SIGKILL);
(void) waitpid(pid, &status, 0);
}
}

Expand Down
4 changes: 2 additions & 2 deletions man/man8/zed.8.in
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@ Terminate the daemon.
Events are processed synchronously by a single thread. This can delay the
processing of simultaneous zevents.
.PP
There is no maximum timeout for ZEDLET execution. Consequently, a misbehaving
ZEDLET can delay the processing of subsequent zevents.
ZEDLETs are killed after a maximum of ten seconds.
This can lead to a violation of a ZEDLET's atomicity assumptions.
.PP
The ownership and permissions of the \fIenabled-zedlets\fR directory (along
with all parent directories) are not checked. If any of these directories
Expand Down

0 comments on commit 38280c3

Please sign in to comment.