Skip to content

Commit 38280c3

Browse files
zed: reap child after killing on time-out
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 #11769 Closes #11798
1 parent 2b56a63 commit 38280c3

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cmd/zed/zed_exec.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ _zed_exec_fork_child(uint64_t eid, const char *dir, const char *prog,
173173
zed_log_msg(LOG_WARNING, "Killing hung \"%s\" pid=%d",
174174
prog, pid);
175175
(void) kill(pid, SIGKILL);
176+
(void) waitpid(pid, &status, 0);
176177
}
177178
}
178179

man/man8/zed.8.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ Terminate the daemon.
234234
Events are processed synchronously by a single thread. This can delay the
235235
processing of simultaneous zevents.
236236
.PP
237-
There is no maximum timeout for ZEDLET execution. Consequently, a misbehaving
238-
ZEDLET can delay the processing of subsequent zevents.
237+
ZEDLETs are killed after a maximum of ten seconds.
238+
This can lead to a violation of a ZEDLET's atomicity assumptions.
239239
.PP
240240
The ownership and permissions of the \fIenabled-zedlets\fR directory (along
241241
with all parent directories) are not checked. If any of these directories

0 commit comments

Comments
 (0)