Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Services] Restart BGP service upon unexpected critical process exit. #4207

Merged
merged 8 commits into from
Mar 4, 2020
Merged

[Services] Restart BGP service upon unexpected critical process exit. #4207

merged 8 commits into from
Mar 4, 2020

Conversation

yozhao101
Copy link
Contributor

  • What I did
    Restart BGP service if one of critical processes running in BGP container exited or crashed abnormally.

  • How I did it
    Generally I follow the framework created by Joe to implement this feature in BGP container.
    First, add supervisor-proc-exit-listener event listener option in Supervisord configuration file in BGP docker container. Supervisord will read a list of critical processes for which to monitor the unexpected crashed and exited.
    Second, configure bgp.service to always auto-restart the service if it stops, with a delay of 30 seconds. Also set a rate limit of 3 restarts within 20 minutes (1200 seconds).

  • How to verify it
    On your switch device, please use docker ps command to list all running docker containers.
    Then use docker exec -it container_id bash to login target container. Typing top command
    on the shell will display all the processes dynamically and you will spot the process id of one
    of the critical processes. Finally type the commandkill -9 process_idto terminate one process.
    After exiting the container, you can use watch -n 1 docker ps to dynamically see the restart
    of database container.

critical processes crashed or exited unexpectedly.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
file.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As part of this PR, can you also add the same support to the other BGP containers (docker-fpm-quagga, docker-fpm-gobgp)?

@yozhao101
Copy link
Contributor Author

Yes, I will add that.

of its processes crahsed or exited unexpectedly.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
of its critical processes crashed or exited unexpectedly.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
supervisord.conf file.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
@yozhao101
Copy link
Contributor Author

@jleveque Please help me review these changes on gobgp and quagga.

rules/docker-fpm-frr.mk Outdated Show resolved Hide resolved
rules/docker-fpm-gobgp.mk Outdated Show resolved Hide resolved
rules/docker-fpm-quagga.mk Outdated Show resolved Hide resolved
Signed-off-by: Yong Zhao <yozhao@microsoft.com>
rules/docker-fpm-frr.mk Outdated Show resolved Hide resolved
rules/docker-fpm-quagga.mk Show resolved Hide resolved
rules/docker-fpm-quagga.mk and rules/docker-fpm-frr.mk.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants