-
Notifications
You must be signed in to change notification settings - Fork 49
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
refactor: replaced dbg! with trace macro #1314
Conversation
@pjenvey hoping to discuss this and get some additional context on |
.circleci/config.yml
Outdated
@@ -10,10 +10,10 @@ commands: | |||
steps: | |||
- run: | |||
name: Setup Rust | |||
command: | | |||
rustup install stable |
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.
Were these commands commented out just because there was a temporary mismatch between the Rust version specified in the Dockerfile and the Rust version being pulled in here? If so, we can probably the Dockerfile and uncomment these lines now, right? Looks like there's a 1.61 buster image now: https://hub.docker.com/_/rust
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.
Alternatively, do we need these commands at all if we always want to use the Rust version given to us by the Docker image?
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.
FWIW, Rust Docker images usually are available the day after a rust release. It's been quite some time since there's been a breaking change between versions of rust, or a rust update causing something like fmt
or clippy
to fail. I'd be curious why those were commented out.
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 talked with Phil and he had said this had happened in previous builds. I did a commenting out of the steps here so as to not eliminate them until we'd discussed the need or lack of need to have those commands there. There were no local compilation issues on my machine and it was the CircleCI builds breaking due to this reason and we found some evidence of other cases.
.circleci/config.yml
Outdated
@@ -57,6 +57,7 @@ commands: | |||
- run: | |||
name: cargo build | |||
command: cargo build | |||
no_output_timeout: 20m |
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.
Isn't cargo build fairly chatty?
20m of no output seems a bit long. Why are we using this value?
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 discussed with Phil and we thought that this helps avoid the problem of there not being chatty output, which in this case was the problem. We saw stalling on the MySQL side of things and if you look, it took 22 min to cargo-build
, 32 for the docker image. If you can think of another way to handle this, it sounds good to me, but this ended up fixing the problem when it came to passing the CircleCI checks.
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.
It might be worth investigating ways to cut down on the syncstorage build time as part of the sync modernization work because it is getting quite lengthy
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.
FWIW, it appears the source of this may actually be a regression in Rust 1.61.0 itself. I've opened a PR (#1326) to address this by pinning Rust to 1.60.0. As @pjenvey noted here, we should probably start pinning to a particular Rust version anyway (instead of just grabbing the latest version) to ensure that the version in the Dockerfile and the version in the CircleCI file always match.
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.
Agreed @ethowitz! Since that PR is now merged, how would you like to proceed with closing this out given the changes in the CircleCI config? Thanks!
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.
You can go ahead and rebase with the master branch to pull the changes in. I think we can remove this line (the one that extends the timeout to 20 minutes). From what I can tell, I think we should also remove the rustup
commands you commented out: we're using circleci images that have the correct version of rust pre-installed, so I think those commands prob aren't necessary
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.
Ok, I made the changes to the file, only leaving the output of what Rust version is currently built, though is there any merit to leaving the 20 min timeout? I'm letting it run now to see how long it may take to build again given these changes.
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 looks good to me!
Description
Simple change to replace
dbg!
marco with the slog-rstrace!
macro, since thedbg!
was resulting in stderr output, not to stdout.Testing
Compiles and matches patterns in rest of
handlers.rs
file.Had to make alterations within the
.circleci
yaml file. @pjenvey was essential in identifying issue where cargo build pulls in most recent rust version which is often at odds with the specified version in the Docker build, which is explicitly hard-coded.Commented out commands to build rust and update which would override specified version in CI/CD. In the future, these lines can be commented back in and a
|
inserted at start of command directive.Also, it was necessary to add the
no_output_timeout
directive tocargo build
to allow for longer compilation times.How should reviewers test?
Ensure GCP logs show output of trace!("Batch: Appending to {}", &new_batch.id); replacing previous
dbg!
hereIssue(s)
Closes link.