-
Notifications
You must be signed in to change notification settings - Fork 14
Fix graceful shutdown #326
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
Conversation
f32571d to
c5a838d
Compare
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
cmd/revad/runtime/drivenserver.go
Outdated
| if srv := newServer(HTTP, mainConf, options); srv != nil { | ||
| return srv | ||
| } | ||
| options.Logger.Fatal().Msg("nothing to do, no http enabled_services declared in config") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The log message seems misleading. If there were no http enabled service in the config we'd already returned on line 50.
This line in only reached if newServer for whatever reason fails to initialize the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the NewDriven... functions we can Fatal error because we are still parsing the config.
cmd/revad/runtime/drivenserver.go
Outdated
| func (s *server) Start() error { | ||
| if s.srv == nil { | ||
| err := fmt.Errorf("reva %s server not initialized", s.protocol) | ||
| s.log.Fatal().Err(err).Send() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about the Fatal level here? Shouldn't we let the caller decide whether exiting is the right thing to do or not?
Consider this a comment of Fatal throught the PR. (I am too lazy to repeat it everywhere)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since Start() acually returns an error we should not Fatal in it. Updated.
cmd/revad/runtime/drivenserver.go
Outdated
| } | ||
|
|
||
| host, _ := os.Hostname() | ||
| log.Info().Msgf("host info: %s", host) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message alone, especially in the case when starting everything from a single binary seems not useful at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved this to a log field ... and got rid of the Msgf() ... brrr
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
3884e30 to
f52e24a
Compare
…-eu#326) Bumps [golang.org/x/term](https://github.com/golang/term) from 0.32.0 to 0.33.0. - [Commits](golang/term@v0.32.0...v0.33.0) --- updated-dependencies: - dependency-name: golang.org/x/term dependency-version: 0.33.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
port of owncloud#272