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

Improved xcvrd shutdown flow #1

Closed
wants to merge 3 commits into from

Conversation

nazariig
Copy link
Owner

Signed-off-by: Nazarii Hnydyn [email protected]

@@ -90,19 +93,17 @@ def log_error(msg, also_print_to_console=False):
#========================== Signal Handling ==========================

def signal_handler(sig, frame):
global RUN
Copy link

Choose a reason for hiding this comment

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

Kevin has submitted a PR to unify helper functions that used by all the daemons, signal handler is part of it since his PR is approved and above to merge, I think you need to look at his PR and align with him. Here is his PR: sonic-net/sonic-buildimage#2570

Copy link
Owner Author

Choose a reason for hiding this comment

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

@keboliu i have reviewed Kevin's changes and i am strongly disagree with a such approach. I had a discussion with @andriymoroz-mlnx and decided to open this PR as is.

My major concerns are:

  1. Incorrect usage of signal handlers: throwing an exception in application main process thru calling sys.exit inside a signal handler is a bad practise
  2. Placing a signal handlers in common class is also a bad practise

I think that each daemon should have a graceful shutdown flow.

@nazariig nazariig force-pushed the master-improve-xcvrd-shutdown branch 3 times, most recently from b7461e3 to 9ec1636 Compare February 22, 2019 16:16
@nazariig nazariig force-pushed the master-improve-xcvrd-shutdown branch from fd1e078 to aee8250 Compare March 15, 2019 13:31
Signed-off-by: Nazarii Hnydyn <[email protected]>
@nazariig nazariig force-pushed the master-improve-xcvrd-shutdown branch from aee8250 to 13c1f22 Compare March 19, 2019 18:29
@nazariig nazariig closed this Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants