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

Use CScheduler for wallet flushing, remove ThreadFlushWalletDB #9605

Merged
merged 3 commits into from Mar 7, 2017

Conversation

Projects
None yet
5 participants
@TheBlueMatt
Copy link
Contributor

commented Jan 20, 2017

Also uses std::function instead of boost::function.

@sipa
Copy link
Member

left a comment

Concept ACK

@@ -23,7 +22,7 @@
//
// CScheduler* s = new CScheduler();
// s->scheduleFromNow(doSomething, 11); // Assuming a: void doSomething() { }
// s->scheduleFromNow(boost::bind(Class::func, this, argument), 3);
// s->scheduleFromNow(std::bind(Class::func, this, argument), 3);
// boost::thread* t = new boost::thread(boost::bind(CScheduler::serviceQueue, s));

This comment has been minimized.

Copy link
@sipa

sipa Jan 20, 2017

Member

Adapt comment here as well?

This comment has been minimized.

Copy link
@TheBlueMatt

TheBlueMatt Jan 20, 2017

Author Contributor

No, it still must run inside a boost::thread because it relies on boost::interruption_point. I believe @theuni is planning on cleaning that up.

This comment has been minimized.

Copy link
@TheBlueMatt

TheBlueMatt Jan 20, 2017

Author Contributor

well technically boost::thread takes a boost::function, so I assume if you uses std::bind it would create a boost::function around the std::function......I'll let cory do that when we kill boost::threads.

This comment has been minimized.

Copy link
@theuni

theuni Jan 21, 2017

Member

Yes, I have a local branch with CScheduler converted. I'm doing them in chunks, because the last huge PR proved to be too big to review/rebase. I'll submit that one next (#9566 is the current one).

@sipa

This comment has been minimized.

Copy link
Member

commented Jan 20, 2017

@theuni

This comment has been minimized.

Copy link
Member

commented Jan 21, 2017

Concept ACK!. I've considered doing this a few times as well.

src/wallet/walletdb.cpp Outdated
@@ -768,67 +768,60 @@ DBErrors CWalletDB::ZapWalletTx(CWallet* pwallet, vector<CWalletTx>& vWtx)
return DB_LOAD_OK;
}

void ThreadFlushWalletDB()
void MaybeFlushWalletDB()

This comment has been minimized.

Copy link
@laanwj

laanwj Jan 23, 2017

Member

If you're renaming this function please, finally, change it to something else than FlushWalletDB. What is being done here is not merely a flush (those are done all the time as CWalletDB instances go out of scope) but more like "database consolidation", merging the log files into wallet.dat so that the wallet is self-contained. This has confused many people over time.

This comment has been minimized.

Copy link
@TheBlueMatt

TheBlueMatt Jan 23, 2017

Author Contributor

Done, called it "compact"

@laanwj

This comment has been minimized.

Copy link
Member

commented Jan 23, 2017

Concept ACK

@laanwj

This comment has been minimized.

Copy link
Member

commented Jan 26, 2017

Thank you! utACK 30f8d50

@laanwj laanwj added this to the 0.15.0 milestone Feb 6, 2017

@TheBlueMatt TheBlueMatt force-pushed the TheBlueMatt:2017-01-cscheduler-cleanups branch Feb 8, 2017

@TheBlueMatt

This comment has been minimized.

Copy link
Contributor Author

commented Feb 8, 2017

Rebased. Note that this now forms the first of a rather long patchset to move wallet callbacks into a background thread without introducing races in APIs or wallet consistency issues.

@theuni

This comment has been minimized.

Copy link
Member

commented Mar 6, 2017

utACK. Needs rebase.

@TheBlueMatt TheBlueMatt force-pushed the TheBlueMatt:2017-01-cscheduler-cleanups branch to 0235be1 Mar 6, 2017

@TheBlueMatt

This comment has been minimized.

Copy link
Contributor Author

commented Mar 6, 2017

Rebased.

@laanwj

This comment has been minimized.

Copy link
Member

commented Mar 7, 2017

utACK 0235be1

@laanwj laanwj merged commit 0235be1 into bitcoin:master Mar 7, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

laanwj added a commit that referenced this pull request Mar 7, 2017

Merge #9605: Use CScheduler for wallet flushing, remove ThreadFlushWa…
…lletDB

0235be1 Rename FlushWalletDB -> CompactWalletDB, add function description (Matt Corallo)
735d9b5 Use CScheduler for wallet flushing, remove ThreadFlushWalletDB (Matt Corallo)
73296f5 CScheduler boost->std::function, use millisecs for times, not secs (Matt Corallo)

Tree-SHA512: c04f97beab65706c444c126be229d02887df9b0972d8fb15ca1f779ef0e628cf7ecef2bf533c650d9b44645b63e01de22f17266a05907e778938d64cc6e19de6

PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jan 21, 2019

Merge bitcoin#9605: Use CScheduler for wallet flushing, remove Thread…
…FlushWalletDB

0235be1 Rename FlushWalletDB -> CompactWalletDB, add function description (Matt Corallo)
735d9b5 Use CScheduler for wallet flushing, remove ThreadFlushWalletDB (Matt Corallo)
73296f5 CScheduler boost->std::function, use millisecs for times, not secs (Matt Corallo)

Tree-SHA512: c04f97beab65706c444c126be229d02887df9b0972d8fb15ca1f779ef0e628cf7ecef2bf533c650d9b44645b63e01de22f17266a05907e778938d64cc6e19de6

PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jan 27, 2019

Merge bitcoin#9605: Use CScheduler for wallet flushing, remove Thread…
…FlushWalletDB

0235be1 Rename FlushWalletDB -> CompactWalletDB, add function description (Matt Corallo)
735d9b5 Use CScheduler for wallet flushing, remove ThreadFlushWalletDB (Matt Corallo)
73296f5 CScheduler boost->std::function, use millisecs for times, not secs (Matt Corallo)

Tree-SHA512: c04f97beab65706c444c126be229d02887df9b0972d8fb15ca1f779ef0e628cf7ecef2bf533c650d9b44645b63e01de22f17266a05907e778938d64cc6e19de6

PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Jan 29, 2019

Merge bitcoin#9605: Use CScheduler for wallet flushing, remove Thread…
…FlushWalletDB

0235be1 Rename FlushWalletDB -> CompactWalletDB, add function description (Matt Corallo)
735d9b5 Use CScheduler for wallet flushing, remove ThreadFlushWalletDB (Matt Corallo)
73296f5 CScheduler boost->std::function, use millisecs for times, not secs (Matt Corallo)

Tree-SHA512: c04f97beab65706c444c126be229d02887df9b0972d8fb15ca1f779ef0e628cf7ecef2bf533c650d9b44645b63e01de22f17266a05907e778938d64cc6e19de6

PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Feb 5, 2019

Merge bitcoin#9605: Use CScheduler for wallet flushing, remove Thread…
…FlushWalletDB

0235be1 Rename FlushWalletDB -> CompactWalletDB, add function description (Matt Corallo)
735d9b5 Use CScheduler for wallet flushing, remove ThreadFlushWalletDB (Matt Corallo)
73296f5 CScheduler boost->std::function, use millisecs for times, not secs (Matt Corallo)

Tree-SHA512: c04f97beab65706c444c126be229d02887df9b0972d8fb15ca1f779ef0e628cf7ecef2bf533c650d9b44645b63e01de22f17266a05907e778938d64cc6e19de6

PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Feb 5, 2019

Merge bitcoin#9605: Use CScheduler for wallet flushing, remove Thread…
…FlushWalletDB

0235be1 Rename FlushWalletDB -> CompactWalletDB, add function description (Matt Corallo)
735d9b5 Use CScheduler for wallet flushing, remove ThreadFlushWalletDB (Matt Corallo)
73296f5 CScheduler boost->std::function, use millisecs for times, not secs (Matt Corallo)

Tree-SHA512: c04f97beab65706c444c126be229d02887df9b0972d8fb15ca1f779ef0e628cf7ecef2bf533c650d9b44645b63e01de22f17266a05907e778938d64cc6e19de6

PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Feb 5, 2019

PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Feb 5, 2019

PastaPastaPasta added a commit to PastaPastaPasta/dash that referenced this pull request Feb 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.