mempool_persist.py failing in travis #12863

issue jnewbery openend this issue on April 2, 2018
  1. jnewbery commented at 8:47 pm on April 2, 2018: member

    Reported here: #10244 (comment)

    Travis log here: https://travis-ci.org/bitcoin/bitcoin/jobs/361243719#L2810

    Note the JSON exception:

    0test_framework.authproxy.JSONRPCException: The mempool was not loaded yet (-1) 
    

    That exception was introduced here: https://github.com/bitcoin/bitcoin/commit/cb1e319fe9e198c9c5cf5236fe9af5a3d748b9e8#diff-a0c8f511d90e83aa9b5857e819ced344R1617

    cc @jtimon

  2. meshcollider added the label Tests on Apr 2, 2018
  3. MarcoFalke commented at 10:08 pm on April 2, 2018: member

    The transaction are probably successfully added to the mempool, otherwise the assertion would fail https://github.com/bitcoin/bitcoin/blob/c564424d98b1561f16e633528172b3583719e5f3/test/functional/mempool_persist.py#L94

    I suspect, it is a race where LoadMempool is still running/about to finish.

  4. MarcoFalke added the label good first issue on Apr 2, 2018
  5. laanwj commented at 8:11 am on April 3, 2018: member

    Short term fix: when it gets that exception, it should probably retry instead of giving up.

    Longer term this would be a reason to prefer using a mutex to avoid preliminary or concurrent access to the mempool dump instead of returning an error. The RPC could just wait.

  6. promag commented at 10:35 pm on April 3, 2018: member
    Could we have the test framework wait for mempool to load?
  7. promag commented at 10:36 pm on April 3, 2018: member

    Referencing @MarcoFalke comment in #12842 (comment):

    I think we had reports that loading the mempool took 1.5 hours or so, just noting without further comment.

  8. ajtowns commented at 5:55 am on April 13, 2018: member

    Could we have the test framework wait for mempool to load?

    The test case already waits for the mempool to load; it checks it via len(n.getrawmempool())==5, but I guess the problem is that between loading the 5th tx and updating the global flag, it also releases cs_main, reprioritises transactions, and notes a couple of log entries, which is enough time for python to race on and try saving the mempool data.

    FWIW, adding MilliSleep(200); just before the final LogPrintf in LoadMemPool looks like it reproduces the problem pretty reliably to me.

    Fixing that problem gives another though: there’s a check for “Unable to dump mempool to disk” further on, which can also give the “mempool was not loaded yet” error. That can be worked around too, but maybe it would be better to just make the g_is_mempool_loaded flag visible via getmempoolinfo so the tests can wait accurately?

  9. MarcoFalke closed this on May 1, 2019

  10. MarcoFalke referenced this in commit 12aa2ac988 on May 1, 2019
  11. vijaydasmp referenced this in commit 185d1f3546 on Oct 21, 2021
  12. vijaydasmp referenced this in commit e27c1a393b on Oct 21, 2021
  13. vijaydasmp referenced this in commit 47375dbecd on Oct 22, 2021
  14. vijaydasmp referenced this in commit 8e8588a542 on Oct 22, 2021
  15. vijaydasmp referenced this in commit bfe027d095 on Oct 23, 2021
  16. vijaydasmp referenced this in commit b9561673fa on Oct 26, 2021
  17. vijaydasmp referenced this in commit 19ba92ca28 on Dec 6, 2021
  18. vijaydasmp referenced this in commit 1634550d9e on Dec 10, 2021
  19. vijaydasmp referenced this in commit d5e24debd4 on Dec 10, 2021
  20. vijaydasmp referenced this in commit 71941b7c23 on Dec 10, 2021
  21. vijaydasmp referenced this in commit 1520ebfaa2 on Dec 11, 2021
  22. vijaydasmp referenced this in commit f6bc96c0ca on Dec 11, 2021
  23. vijaydasmp referenced this in commit 9966abbd90 on Dec 11, 2021
  24. vijaydasmp referenced this in commit 92032654d6 on Dec 11, 2021
  25. vijaydasmp referenced this in commit 4a2dceb202 on Dec 11, 2021
  26. vijaydasmp referenced this in commit 75ad56190f on Dec 13, 2021
  27. vijaydasmp referenced this in commit c5f428c2d2 on Dec 13, 2021
  28. vijaydasmp referenced this in commit 3c44a4aa24 on Dec 13, 2021
  29. vijaydasmp referenced this in commit 4bb33614e8 on Dec 14, 2021
  30. vijaydasmp referenced this in commit b25e8edf15 on Dec 14, 2021
  31. vijaydasmp referenced this in commit 516865bf80 on Dec 15, 2021
  32. vijaydasmp referenced this in commit 497b047cc6 on Dec 15, 2021
  33. MarcoFalke locked this on Dec 16, 2021
  34. vijaydasmp referenced this in commit 4e4caff322 on Dec 18, 2021
  35. vijaydasmp referenced this in commit 64fb6b3a05 on Dec 21, 2021
  36. vijaydasmp referenced this in commit f79ef7e386 on Dec 21, 2021
  37. vijaydasmp referenced this in commit be0111694f on Dec 24, 2021
  38. vijaydasmp referenced this in commit 71e38b9ebc on Dec 25, 2021
  39. gades referenced this in commit 16e2406cd4 on May 24, 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: 2024-07-01 13:12 UTC

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