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

tech debt: Indexer initialization improvements #1352

Merged
merged 3 commits into from
Dec 7, 2022

Conversation

winder
Copy link
Contributor

@winder winder commented Nov 30, 2022

Summary

  • Print correct logfile.
  • Do not use logger before initialized.
  • Do not require data dir in read-only mode.
  • Print error messages to the console.
  • Avoid calling BindFlagSet twice.
  • Replace some instances of panic with an error return.

Test Plan

Existing / new unit tests.
Manual testing.

@winder winder added Enhancement New feature or request Bug-Fix and removed Enhancement New feature or request labels Nov 30, 2022
@codecov
Copy link

codecov bot commented Nov 30, 2022

Codecov Report

Merging #1352 (d35f886) into develop (7d7f31e) will decrease coverage by 2.07%.
The diff coverage is n/a.

❗ Current head d35f886 differs from pull request most recent head cb0a2ec. Consider uploading reports for the commit cb0a2ec to get more accurate results

@@             Coverage Diff             @@
##           develop    #1352      +/-   ##
===========================================
- Coverage    62.78%   60.71%   -2.08%     
===========================================
  Files           76       76              
  Lines        10377    10909     +532     
===========================================
+ Hits          6515     6623     +108     
- Misses        3303     3699     +396     
- Partials       559      587      +28     
Impacted Files Coverage Δ
api/generated/v2/routes.go 25.41% <0.00%> (-2.33%) ⬇️
api/handlers.go 75.35% <0.00%> (-0.18%) ⬇️
util/util.go 76.92% <0.00%> (ø)
importer/helper.go 8.61% <0.00%> (ø)
conduit/plugins/exporters/postgresql/util/prune.go 75.00% <0.00%> (ø)
...plugins/processors/filterprocessor/gen/generate.go 0.00% <0.00%> (ø)
...lugins/processors/filterprocessor/fields/filter.go 80.00% <0.00%> (ø)
accounting/eval_preload.go 76.87% <0.00%> (+0.94%) ⬆️
api/generated/common/routes.go 46.51% <0.00%> (+10.14%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@winder winder marked this pull request as ready for review November 30, 2022 16:51
Comment on lines -108 to +109
panic(exit{1})
fmt.Fprintf(os.Stderr, "Exiting with error: %s\n", err.Error())
os.Exit(1)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We weren't printing errors returned from runDaemon!

Panic is no longer needed, if daemon returns then defer was able to run properly.

* Print correct logfile.
* Do not use logger before initialized.
* Do not require data dir in read-only mode.
@winder winder merged commit 1784895 into algorand:develop Dec 7, 2022
@winder winder deleted the will/init-improvements branch December 7, 2022 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants