-
Notifications
You must be signed in to change notification settings - Fork 80
Fix downloader issues #545
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
Conversation
add dump funcs for chain bundles & orphaned links
Codecov Report
@@ Coverage Diff @@
## master #545 +/- ##
==========================================
+ Coverage 81.45% 81.81% +0.35%
==========================================
Files 154 153 -1
Lines 12857 12993 +136
==========================================
+ Hits 10473 10630 +157
+ Misses 2384 2363 -21
Continue to review full report at Codecov.
|
node/silkworm/downloader/internals/preverified_hashes_mainnet.cpp
Outdated
Show resolved
Hide resolved
cmd/download_headers.cpp
Outdated
log::Settings settings; | ||
settings.log_threads = true; | ||
log::init(settings); | ||
log::set_verbosity(log::Level::kInfo); | ||
log::tee_file(std::filesystem::path("downloader.log")); |
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'd suggest to to set the file name into settings directly and let log::init(settings)
do the rest.
log::Settings settings;
settings.log_file = "downloader.log";
log::init(settings);
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.
BTW ... you don't set a CLI argument to set verbosity level : as a result, being defaulted to Info, all traces are not printed.
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 just introduced CLI argument for log verbosity level, as you suggested
In
As this is a "timed wait" I interpret it as "wait until some other thread pushes something in the queue". But this cannot happen as the very moment we enter here we lock the mutex hence any I'd have created a second mutex for the cv awaiter and rewrite as
This allows other threads to push items and the cv to notify. We also save a lambda which capture the whole Same speech for |
In
I find this simpler and immediate to understand
|
AFAIK the code seems correct as it is because the |
You're right sorry ... forgot the unlock by the cv and the fact waiting with predicate returns the result of the predicate, not of the waiting. My fault : big mistake. |
This PR fixes some downloader issues which in some cases stalled the downloader.