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 Telemetry service upon unexpected critical process exit. #3768

Merged
merged 7 commits into from
Nov 19, 2019
Merged

[Services] Restart Telemetry service upon unexpected critical process exit. #3768

merged 7 commits into from
Nov 19, 2019

Conversation

yozhao101
Copy link
Contributor

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

  • How I did it
    Generally I follow the framework created by Joe to implement this feature in Telemetry container.
    First, add supervisor-proc-exit-listener event listener option in Supervisord configuration file in Telemetry docker container. Supervisord will read a list of critical processes for which to monitor the unexpected crashed and exited.
    Second, configure telemetry.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 command kill -9 process_id to terminate one process.
    After exiting the container, you can use watch -n 1 docker ps to dynamically see the restart
    of Telemetry container.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
processes file into dockerfile.j2.

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

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
wants to restart this container more than 3 times in 20 minutes.

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
into shared Makefile telemetry.mk.

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.

Please also make the following changes to supervisord.conf:

  • rsyslogd: autorestart=true
  • telemetry: autorestart=false
  • dialout: autorestart=false

@yozhao101
Copy link
Contributor Author

I will do that.

auto-restart of rsyslogd and disable auto-restart of another two
processes telemetry and dialout.

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

Signed-off-by: Yong Zhao <yozhao@microsoft.com>
@jleveque jleveque merged commit df11b2b into sonic-net:master Nov 19, 2019
zhenggen-xu pushed a commit to zhenggen-xu/sonic-buildimage that referenced this pull request Jan 10, 2020
… exit. (sonic-net#3768)

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.

2 participants