Unidentified thread created in FlushStateToDisk() #19199

issue hebasto opened this issue on June 7, 2020
  1. hebasto commented at 1:52 PM on June 7, 2020: member

    While testing #19197, a strange, at least for me, behavior has been observed during reindexing with:

    $ ./src/bitcoind -testnet -reindex
    

    When the dbcache reaches its maximum and the following lines appear in the log:

    2020-06-07T13:24:37Z [loadblk] Cache size (761427872) exceeds total space (761373440)
    2020-06-07T13:24:42Z [loadblk] FlushStateToDisk: write coins cache to disk (5389943 coins, 761427kB) started
    2020-06-07T13:24:50Z [loadblk] FlushStateToDisk: write coins cache to disk (5389943 coins, 761427kB) completed (7.60s)
    

    a new thread has been created by the client.

    The strange thing is that this thread is named "loadblk". I understand that it couldn't be the ThreadImport thread as it is guarded by CImportingNow instance.

    In my tests this unidentified thread is mostly named "loadblk", but once I've noted "msghand" name.

    It seems this thread is unjoined until the client shutdown.


    Some screenshots:

    Screenshot from 2020-06-07 10-02-35

    Screenshot from 2020-06-07 16-51-13


    System: x86_64, Linux Mint 19.3 (Ubuntu 18.04 code base)

  2. hebasto added the label Bug on Jun 7, 2020
  3. MarcoFalke commented at 2:40 PM on June 7, 2020: member

    Does leveldb start threads?

  4. sipa commented at 4:26 PM on June 7, 2020: member

    Yeah, I assume it's one of the LevelDB threads. I vaguely remember a PR recently to rename it.

  5. hebasto commented at 4:28 PM on June 7, 2020: member

    Does leveldb start threads?

    Yes, it does. From the leveldb docs:

    When the size of level L exceeds its limit, we compact it in a background thread.

  6. hebasto commented at 4:29 PM on June 7, 2020: member

    I vaguely remember a PR recently to rename it.

    #18790. But the "Name leveldb thread with its own name" (d8e3cf858c388fc15b5d5a506e2fa551d1fc0e07) commit was dropped.

  7. hebasto commented at 7:39 PM on June 7, 2020: member

    I verified. It is a leveldb background thread.

  8. hebasto closed this on Jun 7, 2020

  9. DrahtBot locked this on Feb 15, 2022

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-14 15:14 UTC

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