You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If ThreadDumper wakes up to save to disk periodically, it may miss nodes that are otherwise good and won't save them to disk. This is because it basically is getting nodes to save to disk from CAddrDb from its two lists: ourId and unkId.
However, when the crawler threads run, they "take" IPs to check from the CAddrDb class. These nodes are temporarily "popped" off the internal lists ourId and/or unkId (only to be returned later once a good/bad result is determined by the crawler).
So if ThreadDumper wakes up while any crawlers are actively checking nodes.. those nodes won't get saved to disk. :'(
The text was updated successfully, but these errors were encountered:
melroy89
pushed a commit
to BitcoinCash1/Bitcoin-Cash-Node
that referenced
this issue
Oct 10, 2024
The app can now be exited in the usual unix ways (SIGTEM, SIGINT, etc).
The app now fully cleans itself up on exit, and dumps stats to disk
immediately on exit, as opposed to once per hour only (the once per
hour thing still occurs in the background as well, however).
This issue was also something Sipa wanted to fix, see here:
sipa/bitcoin-seeder#76
Note that the extant `ThreadDumper` has an issue when it is saving in
the background: sipa/bitcoin-seeder#108.
A side-effect of this commit is that when the app exits and it does the
final save to disk, no nodes will be lost from the DB, partially
resolving the above issue.
Summary of changes:
- All sleeping in the code (including poll/select) now periodically
polls the newly-introduced "shutdown requested" flag.
- Added asynch-signal-safe handling of app shutdown signals (SIGINT,
etc)
- On app signal, set the shutdown requested flag.
- ThreadCrawler socket select/poll now periodically wakes up to check
the "shutdown requested" flag (this is to allow for fast thread exit
from the crawler threads).
If
ThreadDumper
wakes up to save to disk periodically, it may miss nodes that are otherwise good and won't save them to disk. This is because it basically is getting nodes to save to disk fromCAddrDb
from its two lists:ourId
andunkId
.However, when the crawler threads run, they "take" IPs to check from the
CAddrDb
class. These nodes are temporarily "popped" off the internal listsourId
and/orunkId
(only to be returned later once a good/bad result is determined by the crawler).So if
ThreadDumper
wakes up while any crawlers are actively checking nodes.. those nodes won't get saved to disk. :'(The text was updated successfully, but these errors were encountered: