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

refactor main function #20

Merged
merged 1 commit into from
Jan 19, 2018
Merged

refactor main function #20

merged 1 commit into from
Jan 19, 2018

Conversation

chai2010
Copy link
Contributor

  1. recall main to restart metad is unsafe when panic, fix it
  2. simplify pprof http server goroutine start
  3. log.Fatal will exit, the os.Exit is unused

@martinyunify
Copy link
Collaborator

I'm wondering if it is appropriate to change the default behavior although the behavior is not safe. I think maybe we can utilize golang safe restart library such as https://github.com/fvbock/endless/

@chai2010
Copy link
Contributor Author

IMO, any server should exit when panic.
the endless is only for zero downtime restarts servers, not restart for panic.
and the endless solution is too complex.

it we need auto restart metad, we should use systemd.

@martinyunify
Copy link
Collaborator

yes. I think some descriptions should be added when default behavior is changed. Either providing systemd definition or descriptions in documents would be fine.

1. recall main to restart metad is unsafe when panic, fix it
2. simplify pprof http server goroutine start
3. log.Fatal will exit, the os.Exit is unused
@chai2010
Copy link
Contributor Author

add the docs/service.md to describe how to run metad as a service, and auto restart.

@chai2010 chai2010 merged commit 5acf969 into yunify:master Jan 19, 2018
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.

None yet

2 participants