Fix multithread CScheduler and reenable test #8016

pull paveljanik wants to merge 2 commits into bitcoin:master from paveljanik:20160506_multithread_CScheduler changing 2 files +1 −2
  1. paveljanik commented at 9:10 AM on May 6, 2016: contributor

    This fixes the deadlock in the CScheduler when there are other serviceQueues waiting for the new task to be added to the taskQueue, but schedule notifies only one of them who processes it and ends. And the other ones get stucked waiting for the new task which doesn't come in at all.

    Hard to reproduce, see #6540 for the discussion.

    Fixes #6540.

  2. MarcoFalke added the label Tests on May 6, 2016
  3. fanquake commented at 9:35 AM on May 6, 2016: member

    Will also close #8005

  4. MarcoFalke commented at 9:45 AM on May 6, 2016: member

    Tested ACK

    28655b8:

    $ for i in {1..10000}; do timeout 1 src/test/test_bitcoin --run_test=scheduler_tests &> /dev/null ;echo $? >> /tmp/res ;done;cat /tmp/res|sort|uniq -c
       9630 0
        370 124
    

    70af981:

    $ rm /tmp/res; for i in {1..10000}; do timeout 1 src/test/test_bitcoin --run_test=scheduler_tests &> /dev/null ;echo $? >> /tmp/res ;done;cat /tmp/res|sort|uniq -c
      10000 0
    

    Travis issue unrelated.

  5. laanwj commented at 1:34 PM on May 6, 2016: member

    Thanks for fixing this!

  6. laanwj commented at 4:16 PM on May 6, 2016: member

    For some reason Travis is failing on this due to python zmq problems. I don't understand why, as there is no Python (or zmq) related change here. Will try to clear Travis' caches.

  7. paveljanik commented at 6:42 PM on May 6, 2016: contributor

    This is because my branch is based on the pre-python3 merge. Master is python3, thus there is no zmq module for python2...

  8. Reenable multithread scheduler test. db18ab28c7
  9. Notify other serviceQueue thread we are finished to prevent deadlocks. 166e4b0dfa
  10. paveljanik force-pushed on May 6, 2016
  11. paveljanik commented at 6:45 PM on May 6, 2016: contributor

    Rebased should solve this, I think. Maybe travis kick can help now.

  12. paveljanik commented at 9:19 PM on May 6, 2016: contributor

    This helped. Hmm, shouldn't we temporary add python-zmq back to travis to workaround this?

    Or should we modify the test script that requires python's zmq module to dot no anything when there is no such module installed (this could also simplify the tests setup for everyone!)? @MarcoFalke what do you think?

  13. MarcoFalke commented at 10:16 AM on May 7, 2016: member

    @paveljanik python-zmq is already present in .travis.yml, you can't add it more than once ;)

    I changed it (#7851) to fail instead, so errors are detected (and not silently ignored). The travis failure was an error due to broken cache. I think @laanwj cleared the cache and the travis issue is now fixed.

  14. MarcoFalke commented at 10:16 AM on May 7, 2016: member

    ut re-ACK 166e4b0

  15. paveljanik commented at 3:54 PM on May 7, 2016: contributor

    @MarcoFalke there is python3-zmq, not python-zmq...

  16. theuni commented at 5:39 PM on May 7, 2016: member

    Does it need to signal in the catch/rethrow case as well?

  17. paveljanik commented at 7:47 AM on May 8, 2016: contributor

    @theuni I think rethrow case is there only for f throwing some exception. It is not a case for our multithread test. But in general, yes, I think there could be the same problem for exception throwing f.

  18. laanwj commented at 9:09 AM on May 10, 2016: member

    @paveljanik Are you going to fix that here?

  19. paveljanik commented at 9:45 AM on May 10, 2016: contributor

    No. I'm think about writing another test that will use the exception calls, but not here and not now, sorry.

  20. laanwj commented at 10:08 AM on May 10, 2016: member

    No need to be sorry, thanks for your fix! just needed clarity about which state this pull is in.

    utACK 166e4b0

  21. laanwj merged this on May 10, 2016
  22. laanwj closed this on May 10, 2016

  23. laanwj referenced this in commit 5767e80dda on May 10, 2016
  24. MarcoFalke referenced this in commit 2d2b04543d on Jun 9, 2016
  25. nomnombtc referenced this in commit d961d5007e on Nov 12, 2016
  26. nomnombtc referenced this in commit df85cfbaed on Nov 12, 2016
  27. nomnombtc referenced this in commit c7e39e9bab on Nov 13, 2016
  28. sickpig referenced this in commit e1d69f460b on Nov 14, 2016
  29. LarryRuane referenced this in commit 4798e94186 on Feb 20, 2021
  30. zkbot referenced this in commit d95a957841 on Apr 1, 2021
  31. zkbot referenced this in commit 2d3b58c993 on Apr 1, 2021
  32. MarcoFalke locked this on Sep 8, 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-13 21:15 UTC

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