net: Make poll in InterruptibleRecv only filter for POLLIN events. #16412

pull tecnovert wants to merge 1 commits into bitcoin:master from tecnovert:bitcoin-poll changing 1 files +1 −1
  1. tecnovert commented at 11:18 AM on July 18, 2019: contributor

    poll should block until there is data to be read or the timeout expires.

    Filtering for the POLLOUT event causes poll to return immediately which leads to high CPU usage when trying to connect to non-responding peers through tor.

    When USE_POLL is not defined select is used with the writefds parameter set to nullptr. Removing POLLOUT causes the behavior of poll to match that of select.

    Fixes: #16004.

  2. net: Make poll in InterruptibleRecv only filter for POLLIN events.
    poll should block until there is data to be read or the timeout expires.
    
    Filtering for the POLLOUT event causes poll to return immediately which leads to high CPU usage when trying to connect to non-responding peers through tor.
    
    Removing POLLOUT matches how select is used when USE_POLL isn't defined.
    a52818cc56
  3. fanquake added the label P2P on Jul 18, 2019
  4. fanquake commented at 1:08 PM on July 18, 2019: member

    Potential fix for #16004?

  5. tecnovert commented at 2:00 PM on July 18, 2019: contributor

    That's almost certainly the same problem I had.

    Sorry I didn't notice there was an open issue for it.

  6. fanquake added this to the milestone 0.18.1 on Jul 18, 2019
  7. fanquake added the label Needs backport on Jul 18, 2019
  8. laanwj commented at 2:35 PM on July 18, 2019: member

    Great first contribution, good catch !

    code review ACK a52818cc5633494992da7d1dc8fdb04b4a1b7c29

  9. jonasschnelli commented at 2:57 PM on July 18, 2019: contributor

    Indeed nice first contribution! utACK a52818cc5633494992da7d1dc8fdb04b4a1b7c29

  10. laanwj merged this on Jul 19, 2019
  11. laanwj closed this on Jul 19, 2019

  12. laanwj referenced this in commit f4b1fe7165 on Jul 19, 2019
  13. laanwj referenced this in commit 063c8ce7a0 on Jul 19, 2019
  14. laanwj removed the label Needs backport on Jul 19, 2019
  15. HashUnlimited referenced this in commit 3b78a2b68f on Aug 23, 2019
  16. Bushstar referenced this in commit 8676b12552 on Aug 24, 2019
  17. Bushstar referenced this in commit cf84c95a27 on Aug 24, 2019
  18. Bushstar referenced this in commit 23ba5adb58 on Aug 24, 2019
  19. Bushstar referenced this in commit 2bb4c64d4c on Aug 24, 2019
  20. deadalnix referenced this in commit 20d411097e on Jun 18, 2020
  21. PastaPastaPasta referenced this in commit fef222ee22 on Jun 27, 2021
  22. PastaPastaPasta referenced this in commit c829979a40 on Jun 28, 2021
  23. PastaPastaPasta referenced this in commit de2f854518 on Jun 29, 2021
  24. PastaPastaPasta referenced this in commit aced52aa6c on Jul 1, 2021
  25. PastaPastaPasta referenced this in commit dbff400783 on Jul 1, 2021
  26. PastaPastaPasta referenced this in commit 852798aa91 on Jul 12, 2021
  27. PastaPastaPasta referenced this in commit c2e52af388 on Jul 13, 2021
  28. 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-05-02 12:14 UTC

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