On 9/14/22 08:19, Fengqi Li wrote:
> When segmentation fault occured in ovn-northd, monitor will try to
> restart the ovn-northd daemon process every 10s.
> Assume the following scenarios: There is a segmentation fault and
> the ovn-northd daemon process doen not restart properly everytime.
> Nws fds are created each time the ovn-northd daemon process is
> restarted by the monitor process, but old fds(fd[1]) ownered by
> the monitor process was not closed properly. One pipe leak for
> each restart of the ovn-northd daemon process. After a long time
> the OS's pipe was exhausted.

Hi, Fengqi Li.  Thanks for the patch!

> My ovs version is 2.13.2 and I checked the master branch.It also
> have the same problem.

Please add the following Fixes tag instead of the line above:

Fixes: e2ed6fbeb18c ("fatal-signal: Catch SIGSEGV and print backtrace.")

> 
> Signed-off-by: Fengqi Li <lifen...@inspur.com>
> ---
>  lib/daemon-unix.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/daemon-unix.c b/lib/daemon-unix.c
> index 52f3d4bc6..3e595687f 100644
> --- a/lib/daemon-unix.c
> +++ b/lib/daemon-unix.c
> @@ -412,6 +412,7 @@ monitor_daemon(pid_t daemon_pid)
>                  }
>                  last_restart = time(NULL);
>  
> +                close(daemonize_fd);

I would move this higher as we don't need to hold this file descriptor
for 10 extra seconds.  We can close it right after log_received_backtrace.
And it's better to set it to -1 right after closing to make sure it will
not be used before it actually set.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to