-
Notifications
You must be signed in to change notification settings - Fork 86
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
Log gRPC startup listening when it is listening #482
Conversation
34e7596
to
68c1a3b
Compare
This improvement has been stable for me on a few test severs, I consider it ready to review and merge. Thanks. |
There's a better way to fix this, I believe. Can you check the startup performance when using this patch (applied to master): +++ a/common/cache.go
+++ b/common/cache.go
@@ -244,12 +244,6 @@ func NewBlockCache(dbPath string, chainName string, startHeight int, syncFromHei
offset += int64(length) + 8
c.starts = append(c.starts, offset)
- // Check for corruption.
- block := c.readBlock(c.nextBlock)
- if block == nil {
- Log.Warning("error reading block")
- c.recoverFromCorruption(c.nextBlock)
- break
- }
c.nextBlock++
}
c.setDbFiles In other words, remove the deserialization and checking of each block when reading the When I run this patch, the log messages that say "Reading nnnnn blocks from disk cache" and "Done reading" are within the same second (as shown by their timestamps), so this should be fast enough. But please test this and let me know what you find. This check isn't really needed because it detects corruption in the |
Closing this now because I've merged #484 which I think is a better fix. Please reopen (or open an issue) if you disagree, thanks. |
Okay thanks for the startup speed improvement. Can you also merge the change from this pull request's diff that moves "Starting gRPC server version" to the line where the gRPC server is actually starting? The logging is confusing and inaccurate as-is, thanks! |
Let's reopen this, and if you don't mind, can you update the PR accordingly? Thanks! |
68c1a3b
to
6d801b8
Compare
Force pushed to reduce this PR to just the second commit (correct logging) |
@emersonian - Could you review this PR now? It should take only a minute. Thanks. |
It looks good to me, thanks! When should we anticipate the next release? |
6d801b8
to
93b8973
Compare
@emersonian - I changed it slightly; can you review again? I think it's good to log the version and build information early (like we've always done), but just don't say that the gRPC server is starting. Then later, when we do start it, log another message saying that. Some things happen before starting the gRPC server, such as trying to execute an RPC to the backend zcashd (or zebrad), and if that fails, it would be good to know (if someone ships me a log file) what version and build they were running. Here's what the log file looks like now (with the latest force-push) if I start lightwalletd while zcashd is still starting up (note the now-separated
As for another release, I think we should do one right away with this and a few other good changes we've had recently. |
UPDATE: this PR includes only the second change mentioned below, see #484 for the first change:
Lightwalletd can take upwards of 20 minutes to start when a block cache exists on a magnetic hard drive. When lightwalletd starts up for the first time, it is able to respond to gRPC nearly immediately while the block cache synchronizes in the background. It is confusing that upon second launch the time-to-first-listen is very slow.
This pull request contains two changes:
This is a draft open to community review. I will test this in a staging environment for a few weeks before requesting a merge.
A Docker Hub image of this branch is available for testing at: emersonian/zcash-lwd:v0.4.17-cache1
Please ensure this checklist is followed for any pull requests for this repo. This checklist must be checked by both the PR creator and by anyone who reviews the PR.
As a note, all CI tests need to be passing and all appropriate code reviews need to be done before this PR can be merged