Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-20348

AsyncMockStream framework is not asynchronous

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.1.8
    • Fix Version/s: 3.1.8
    • Component/s: Networking
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Epic Link:
    • Sprint:
      Platform 9 (09/18/15)

      Description

      The async mock stream framework offers a stream that pauses itself to allow the tester to inspect state that has been written to it or read from it by the network interface. Those "pauses" are implemented as follows:

      MockStream::write(buffer, handler) {
           ...
           block(kBlockedAfterWrite);
           ...
           _io_service->post(next task);
      }
      

      This causes the NIA's thread, which has called write(), to hang until the test unblocks it. Then it cannot use that thread for other things, like checking for timed out operations, while the write is "blocked on a socket."

      We should return instead of blocking there, essentially pausing that path of the state machine. The call to unblock(), instead of actually unblocking, should post a new handler to the io_service that runs the part of write() that would have happened after the block.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: