[SERVER-20348] AsyncMockStream framework is not asynchronous Created: 10/Sep/15  Updated: 19/Sep/15  Resolved: 11/Sep/15

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: 3.1.8
Fix Version/s: 3.1.8

Type: Bug Priority: Major - P3
Reporter: Samantha Ritter (Inactive) Assignee: Samantha Ritter (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platform 9 (09/18/15)
Participants:

 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.



 Comments   
Comment by Githook User [ 11/Sep/15 ]

Author:

{u'username': u'samantharitter', u'name': u'samantharitter', u'email': u'samantha.ritter@10gen.com'}

Message: SERVER-20348 make AsyncMockStreams fully asynchronous
Branch: master
https://github.com/mongodb/mongo/commit/f392156ae941c58c7c1dbe9151e1656afd5b0eec

Generated at Thu Feb 08 03:53:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.