Prevent UpdateTip log message from being broken up #16854

pull stevenroose wants to merge 1 commits into bitcoin:master from stevenroose:log-break-updatetip changing 1 files +3 −5
  1. stevenroose commented at 2:29 PM on September 11, 2019: contributor

    We had some occurrences of log messages colliding:

    $ grep ThreadRPC $(find . -type f -name debug.log -print | grep bitcoind.datadir ) | awk '{$1=""; print $0}' | sort -u                                                                     
     ThreadRPCServer method=sendrawtransaction user=bitcoinrpc
     ThreadRPCServer method=sendtoaddress user=bitcoinrpc
     ThreadRPCServer method=signrawtransactionwithkey user=bitcoinrpc
     UpdateTip: new best=0026711b58616e8d4db7d9bc9f46b746ec535521feb3e0f077e83925e45daa8a height=630 version=0x20000000 log2_work=10.301496 tx=633 date='2019-09-10T00:43:41Z' progress=1.000000 cache=0.1MiB(811txo)ThreadRPCServer method=getblockheader user=bitcoinrpc
     UpdateTip: new best=466304b9c3ed652373d30207f0d99551c568c2dbc648518c077cb40826039e5f height=643 version=0x20000000 log2_work=10.330917 tx=647 date='2019-09-10T00:43:43Z' progress=1.000000 cache=0.1MiB(915txo)ThreadRPCServer method=getblockheader user=bitcoinrpc
    
  2. jamesob commented at 2:52 PM on September 11, 2019: member

    utACK https://github.com/bitcoin/bitcoin/pull/16854/commits/b546c4d286017a3df24bb7ed6a74c0ca5a9d2b96

    Thanks, the occasional line interruption has been annoying.

  3. in src/validation.cpp:2248 in b546c4d286 outdated
    2248 | -      GuessVerificationProgress(chainParams.TxData(), pindexNew), ::ChainstateActive().CoinsTip().DynamicMemoryUsage() * (1.0 / (1<<20)), ::ChainstateActive().CoinsTip().GetCacheSize());
    2249 | -    if (!warningMessages.empty())
    2250 | -        LogPrintf(" warning='%s'", warningMessages); /* Continued */
    2251 | -    LogPrintf("\n");
    2252 | +      GuessVerificationProgress(chainParams.TxData(), pindexNew), ::ChainstateActive().CoinsTip().DynamicMemoryUsage() * (1.0 / (1<<20)), ::ChainstateActive().CoinsTip().GetCacheSize(),
    2253 | +      !warningMessages.empty() ? tfm::format(" warning='%s'", warningMessages) : "");
    


    jamesob commented at 2:53 PM on September 11, 2019:

    I think we may be using strprintf(...) in lieu of tfm::format() for cases like this.


    stevenroose commented at 11:34 AM on September 12, 2019:

    addressed

  4. DrahtBot added the label Validation on Sep 11, 2019
  5. DrahtBot commented at 5:04 PM on September 11, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    No conflicts as of last run.

  6. stevenroose commented at 6:02 PM on September 11, 2019: contributor

    Aaah, that's what it's called! I saw Vladimir removed all sprintf and snprintf mentions from the codebase, so I looked inside LogPrintf what it was using. Is strprintf preferred? Then I'll change it when I get home.

    On Wed, Sep 11, 2019, 15:56 jamesob <notifications@github.com wrote:

    @jamesob commented on this pull request.

    In src/validation.cpp https://github.com/bitcoin/bitcoin/pull/16854#discussion_r323288597:

       pindexNew->GetBlockHash().ToString(), pindexNew->nHeight, pindexNew->nVersion,
       log(pindexNew->nChainWork.getdouble())/log(2.0), (unsigned long)pindexNew->nChainTx,
       FormatISO8601DateTime(pindexNew->GetBlockTime()),
    •  GuessVerificationProgress(chainParams.TxData(), pindexNew), ::ChainstateActive().CoinsTip().DynamicMemoryUsage() * (1.0 / (1<<20)), ::ChainstateActive().CoinsTip().GetCacheSize());
    • if (!warningMessages.empty())
    •    LogPrintf(" warning='%s'", warningMessages); /* Continued */
    • LogPrintf("\n");
    •  GuessVerificationProgress(chainParams.TxData(), pindexNew), ::ChainstateActive().CoinsTip().DynamicMemoryUsage() * (1.0 / (1<<20)), ::ChainstateActive().CoinsTip().GetCacheSize(),
    •  !warningMessages.empty() ? tfm::format(" warning='%s'", warningMessages) : "");

    I think we may be using strprintf(...) in lieu of tfm::format() for cases like this.

    — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bitcoin/bitcoin/pull/16854?email_source=notifications&email_token=AAGQLXB6CPCLOMV7KUGARDTQJEBJJA5CNFSM4IVUYX52YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCEMQPFY#pullrequestreview-286853015, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGQLXHG7YVYB4AAUD5KEOTQJEBJJANCNFSM4IVUYX5Q .

  7. laanwj commented at 6:22 AM on September 12, 2019: member

    Concept ACK

    Is strprintf preferred?

    Yes, it's simply an alias but it'd be more consistent as it's what used everywhere.

  8. fanquake added the label Waiting for author on Sep 12, 2019
  9. stevenroose force-pushed on Sep 12, 2019
  10. Prevent UpdateTip log message from being broken up f390d8556b
  11. stevenroose commented at 11:34 AM on September 12, 2019: contributor

    @laanwj addressed

  12. fanquake removed the label Waiting for author on Sep 12, 2019
  13. jonasschnelli commented at 12:36 PM on September 12, 2019: contributor

    utACK f390d8556ba3db91d9e9e73a48459954584b9058

  14. laanwj commented at 1:31 PM on September 13, 2019: member

    ACK f390d8556ba3db91d9e9e73a48459954584b9058

  15. laanwj referenced this in commit fb4f5beb6e on Sep 13, 2019
  16. laanwj merged this on Sep 13, 2019
  17. laanwj closed this on Sep 13, 2019

  18. sidhujag referenced this in commit f36d0b219d on Sep 15, 2019
  19. kittywhiskers referenced this in commit 74a3bed1fc on Dec 4, 2021
  20. kittywhiskers referenced this in commit 15d035de4f on Dec 8, 2021
  21. kittywhiskers referenced this in commit e580381042 on Dec 12, 2021
  22. kittywhiskers referenced this in commit 11c5fc587a on Dec 13, 2021
  23. kittywhiskers referenced this in commit d81793f08f on Dec 13, 2021
  24. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-30 21:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me