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

cosmovisor: set larger buffer size for cosmovisor to scan log (fix #8651) #8653

Merged
merged 5 commits into from
May 20, 2021

Conversation

allthatjazzleo
Copy link
Contributor

Description

Set larger buffer size for cosmovisor to scan log.
The default 64K is not enough and cosmovisor can be stuck.

closes: #8651


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@@ -27,6 +27,10 @@ type UpgradeInfo struct {
// It returns (nil, err) if the input stream errored
// It returns (nil, nil) if the input closed without ever matching the regexp
func WaitForUpdate(scanner *bufio.Scanner) (*UpgradeInfo, error) {
// set larger buffer in case the line is too long, the default one is 64*1024
const maxCapacity = 512 * 1024
Copy link
Collaborator

Choose a reason for hiding this comment

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

How about making it a ENV setting?

Copy link
Contributor

Choose a reason for hiding this comment

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

It could work - as long as sane defaults are provided 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

update to use ENV setting with defaults provided
@alessio @anilcse

@allthatjazzleo allthatjazzleo force-pushed the cosmovisor_bufio_size branch 2 times, most recently from 100a5dd to 3b6c892 Compare March 5, 2021 11:47
@aaronc aaronc requested a review from robert-zaremba March 5, 2021 21:09
@allthatjazzleo allthatjazzleo force-pushed the cosmovisor_bufio_size branch from 3b6c892 to c471405 Compare April 10, 2021 09:42
Copy link
Collaborator

@anilcse anilcse left a comment

Choose a reason for hiding this comment

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

lgtm.
@clevinson @robert-zaremba do we still need this as we are replacing it with file based approach in #8590

@aaronc
Copy link
Member

aaronc commented May 11, 2021

lgtm.

@clevinson @robert-zaremba do we still need this as we are replacing it with file based approach in #8590

I do think we still want to switch to the file based approach. There are other security reasons to do so.

@tac0turtle
Copy link
Member

@aaronc is this still going to be merged?

@aaronc aaronc added C:Cosmovisor Issues and PR related to Cosmovisor Type: Feature A:automerge Automatically merge PR once all prerequisites pass. labels May 20, 2021
@github-actions github-actions bot added the T:Docs Changes and features related to documentation. label May 20, 2021
@mergify mergify bot merged commit 8216377 into cosmos:master May 20, 2021
roysc pushed a commit to vulcanize/cosmos-sdk that referenced this pull request Jun 23, 2021
…smos#8651) (cosmos#8653)

* cosmovisor: set larger buffer for cosmovisor to scan log (fix cosmos#8651)

* update cosmovisor README and set buffer size to ENV setting

Co-authored-by: Marko <[email protected]>
Co-authored-by: Aaron Craelius <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:automerge Automatically merge PR once all prerequisites pass. C:Cosmovisor Issues and PR related to Cosmovisor T:Docs Changes and features related to documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cosmovisor cannot scan when logs are longer than 64K per line by default
5 participants