[SERVER-34636] enable session_asio opportunistic writes with ssl Created: 24/Apr/18  Updated: 29/Oct/23  Resolved: 26/Apr/18

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: None
Fix Version/s: 4.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Mira Carey Assignee: Mira Carey
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2018-05-07
Participants:

 Description   

We disabled opportunistic write for TLS in session_asio when we dropped the implementation in because it didn't work. specifically, we're talking about setting the socket to non-blocking, then doing a write which would block in the tcp send.

The core of the problem was that asio had no way of forcing the rest of the low level send, because it only had an opportunity to do work when asked to do a write (which worked or not for it's own reasons, generally the size of the openssl buffer being used for encryption). The fix is to expose the unsent buffer in the event of socket failure, and finish the work ourselves with direct calls to write the underlying buffer.



 Comments   
Comment by Githook User [ 26/Apr/18 ]

Author:

{'email': 'jcarey@argv.me', 'username': 'hanumantmk', 'name': 'Jason Carey'}

Message: SERVER-34636 enable opportunistic writes with ssl

Add a side channel to the asio ssl streams which allows us to capture
the work remaining for the tcp send in the event of a full send buffer.

This makes opportunistic writes safe for ssl sockets
Branch: master
https://github.com/mongodb/mongo/commit/5156e623fd7dba3b4964ce1ba80a847b622b15df

Generated at Thu Feb 08 04:37:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.