[SERVER-8338] Socket library send/recv failpoints do not inhibit data transfer when activated Created: 25/Jan/13  Updated: 11/Jul/16  Resolved: 13/Feb/13

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: 2.3.2
Fix Version/s: 2.4.0-rc1

Type: Bug Priority: Minor - P4
Reporter: Andrew Morrow (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Done Votes: 0
Labels: triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-8340 Failpoint for recv errors in sock.cpp... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

The socket library in util/net/sock.cpp provides failpoints for calls into its send and recv methods. However, when enabled, these failpoints do not actually prevent the syscall from executing: they only cause the return value of the send or recv syscall to be ignored and force a branch into the error handling logic.

This makes the failpoints potentially not useful: A test trying to use the failpoints to simulate a network partition, for instance, would see a socket error in the caller, but the intended recipient would actually see the sent data.

When enabled, the socket send/recv failpoints should inhibit data transfer.



 Comments   
Comment by auto [ 13/Feb/13 ]

Author:

{u'date': u'2013-02-07T16:58:39Z', u'name': u'Andrew Morrow', u'email': u'acm@10gen.com'}

Message: SERVER-8338 Inhibit data transfers when socket failpoints are enabled
Branch: master
https://github.com/mongodb/mongo/commit/2ff5550f2a4e3cf19225cb17fdc1c88a4849b61a

Comment by Andrew Morrow (Inactive) [ 07/Feb/13 ]

So, it is pretty clear what the correct behavior is for the send side: if you try to send, and the failpoint is enabled, you get an exception and the data is not sent.

The 'recv' side is harder, because there are two possible behaviors:

  • Don't call recv at all and throw. This leaves any data that was actually sent to the socket queued up.
  • Do call recv for the requested amount, but discard the result and throw.

It is not clear what the correct choice here is.

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