fix: delay in TimeOffset applied to AdjustedTime caused by send/receive message queues, correct pointer alignment issue #28010

pull techy2 wants to merge 2 commits into bitcoin:master from techupgrades:timeoffset changing 2 files +76 −3
  1. techy2 commented at 1:12 AM on June 30, 2023: none

    On busy VPS and shared host with limited resources, the time between when a messages is sent to the tcpip send or receive queue and when it is sent in the case of send queue, or when it is processed (ProcessMessage) can be in excess of 30 seconds. This delay introduces a skew in AdjustedTime.

    For the receive queue, the post processing uses the receive time prior to entering the queue to calculate TimeOffset rather than Now() which currently includes the delay in the queue.

    For the send queue, the queued message is altered to update the nTime of the message to the actual time it is being sent rather than the time at which it was queued

    Was tested on an hp 370 G6 24 core 3ghz 192gb host with the daemon launched with -par=2 to restrict the resources of the daemon. Logging was added pre-patch to document the delay through the queue and was observed for both send and receive to be occasionally > 30 seconds when the daemon was busy following the tip or during reorgs when the cup utilization for the assigned core approached 100%. Significant queue delay occurs most often in the receive queue (several times a minute) and infrequently in the send queue ( 1 observation in several hours of testing ).

    Checklist:

    Go over all the following points, and put an x in all the boxes that apply.

    • [X ] I have performed a self-review of my own code
    • [X ] I have commented my code, particularly in hard-to-understand areas
    • [na ] I have added or updated relevant unit/integration/functional/e2e tests
    • [na ] I have made corresponding changes to the documentation
    • [na ] I have assigned this pull request to a milestone (for repository code-owners and collaborators only)
  2. fix: delay in TimeOffset applied to AdjustedTime caused by send/receive message queues 0cf727382d
  3. fix: delay in TimeOffset applied to AdjustedTime caused by send/receive message queues, pointer offset fixed dda9d86953
  4. DrahtBot commented at 1:12 AM on June 30, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  5. DrahtBot added the label CI failed on Jun 30, 2023
  6. maflcko commented at 5:59 AM on June 30, 2023: member

    No need to open several pulls for the same change. Let's discuss the concept in #28007 first, which you can then reopen and (force) push to.

  7. maflcko closed this on Jun 30, 2023

  8. techy2 commented at 9:48 PM on July 9, 2023: none

    Hola Marco Sorry, I've been away for a while. Please continue discussion as required

  9. bitcoin locked this on Jul 8, 2024
Labels

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-28 00:13 UTC

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