Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@BugDiver
Copy link
Member

No description provided.

@gaugebot gaugebot bot added the cla-signed label Dec 26, 2019
@gaugebot gaugebot bot requested a review from nehashri December 26, 2019 11:54
spectacle.go Outdated

func (h *handler) stopServer() {
h.server.Stop()
os.Exit(0)
Copy link
Member

Choose a reason for hiding this comment

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

is os.Exit necessary here? I would expect it to be at a higher level.

spectacle.go Outdated
gauge_messages.RegisterDocumenterServer(server, h)
fmt.Println(fmt.Sprintf("Listening on port:%d", l.Addr().(*net.TCPAddr).Port))
server.Serve(l)
os.Exit(0)
Copy link
Member

Choose a reason for hiding this comment

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

do we need os.Exit(0)- isn't that the default?

Copy link
Member Author

Choose a reason for hiding this comment

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

In this particular case, we may not need it. But when gauge sends a kill request it expects plugin to kill itself, this is to prevent orphan subprocess.
For Ex. in the case of python, gauge launches a shell process that launches the actual python runner.
If the plugin does not kill itself, the actual python process does not get kill (especially in windows) which leaves orphan processes. Cause gauge kills only shell process.

In this particular case, we might not need it since there is only one binary (golang) involved.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also earlier it was required cause we were breaking from a deferred function.
Now since it's in main, might not be required. Removed it.

@sriv sriv merged commit 9978670 into master Dec 30, 2019
@sriv sriv deleted the gRPC branch December 30, 2019 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants