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

[GOAL2-614] Updated algoh to capture algod logs on early termination #40

Merged

Conversation

@egieseke
Copy link
Contributor

egieseke commented Jun 17, 2019

Please review this change to capture logs In case algod terminates before block watcher initializes.

…ates before block watcher is initialized.

Fix code analysis warnings.
@egieseke egieseke requested review from Karmastic and algobolson Jun 17, 2019
flag.Parse()
nc := getNodeController()

genesisID, err := nc.GetGenesisID()
if err != nil {
fmt.Fprintln(os.Stdout, "error loading telemetry config", err)
_, _ = fmt.Fprintln(os.Stdout, "error loading telemetry config", err)

This comment has been minimized.

Copy link
@Karmastic

Karmastic Jun 18, 2019

Contributor

What's the purpose of the "_, _"? Were you getting lint errors or something? I think we're fine sticking with our standard convention of not doing this - unless there's a reason we need to start doing this, please don't.

This comment has been minimized.

Copy link
@egieseke

egieseke Jun 18, 2019

Author Contributor

OK, Goland required to get the green check for code analysis. I will remove.

Copy link
Contributor

Karmastic left a comment

Thanks for tackling this. A few requests.

close(done)

// capture logs if algod terminated prior to blockWatcher starting
if !blockWatcherInitialized && algohConfig.UploadOnError {
if errorOutput.output != "" {

This comment has been minimized.

Copy link
@Karmastic

Karmastic Jun 18, 2019

Contributor

This looks like a duplicate of the code below - please consolidate. Also - this block should not all be gated by 'UploadOnError' - that should only affect whether we call sendLogs(), like below.

This comment has been minimized.

Copy link
@egieseke

egieseke Jun 18, 2019

Author Contributor

OK,Refactored into a separate method collectErrorLogs(). Removed UploadOnError condition.

Removed blank identifiers.
@egieseke egieseke requested a review from Karmastic Jun 18, 2019
@egieseke egieseke dismissed Karmastic’s stale review Jun 19, 2019

Consolidated error logging as recommended, please re review.

Copy link
Contributor

Karmastic left a comment

Thanks!

@Karmastic Karmastic merged commit 1e099cf into algorand:master Jun 20, 2019
2 checks passed
2 checks passed
Travis CI - Pull Request Build Passed
Details
license/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.