btc: save graph_db stat log on clean shutdown (LTC-parity site 3/3) - #1100
Draft
frstrtr wants to merge 1 commit into
Draft
btc: save graph_db stat log on clean shutdown (LTC-parity site 3/3)#1100frstrtr wants to merge 1 commit into
frstrtr wants to merge 1 commit into
Conversation
main_btc.cpp stood up load-on-start (:1722) + periodic-100s (:1735) persistence but omitted the save-on-shutdown site LTC has at main_ltc.cpp:7456-7457. Without it, every clean restart drops whatever accumulated in the graph_db stat log since the last 100s tick, so the dashboard series only survives when a periodic tick happens to land before shutdown. Add the third call site after the run loop returns, while web_server (and its MiningInterface) is still alive, before the teardown resets. Isolation: src/c2pool/main_btc.cpp only, zero src/core, zero cross-coin. p2pool-merged-v36 surface: NONE (operator dashboard stat log, not share/PPLNS/coinbase bytes).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
src/c2pool/main_btc.cppstands up the graph_db stat-log with only 2 of LTC's 3 persistence sites:main_btc.cpp:1722mi->load_stat_log();main_btc.cpp:1735mi->save_stat_log();main_ltc.cpp:7456-7457).Effect: everything accumulated in the final sub-100s window is dropped on every clean restart. The dashboard series only survives when a periodic tick happens to land before shutdown. Same 2/3 gap DGB fixed in #1097.
Change
One null-guarded call added after the run loop returns (the
while (!shutdown_initiated)run_for-slice loop), whileweb_serverand itsMiningInterfaceare still alive, before the graceful-teardown resets:Mirrors #1097 / dgb
822eaa347exactly, adapted to BTC line numbers.Isolation
src/c2pool/main_btc.cpponly — BTC's own entrypoint. Zerosrc/core, zero cross-coin (nomain_ltc.cpp/main_dgb.cpptouched). p2pool-merged-v36 surface: NONE (operator dashboard stat log, not share/PPLNS/coinbase bytes).Evidence
(live restart-persist proof captured below — tick lands, clean restart, series survives the shutdown boundary)