[SERVER-54139] Remove CURL share support from HTTP curl client Created: 29/Jan/21  Updated: 29/Oct/23  Resolved: 01/Mar/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.0.22, 4.4.3, 4.2.12
Fix Version/s: 4.9.0, 4.2.13, 4.4.5, 4.0.24

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

Issue Links:
Backports
Problem/Incident
Related
related to SERVER-58161 4.4.3 Segmentation fault starting ser... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4, v4.2, v4.0
Sprint: Security 2021-02-22, Security 2021-03-08
Participants:
Case:
Linked BF Score: 0

 Description   

libcurl's share feature, which is used for a shared connection cache, is not thread safe. This is typically used to support HTTP keep-alive connections. It needs to be removed to improved the stability of the HTTP client when used by multiple threads. This only affects queryable restore. It needs to be backported to all affected versions.

The libcurl documentation (https://curl.se/libcurl/c/curl_share_setopt.html) states

Note that due to a known bug, it is not safe to share connections this way between multiple concurrent threads.

which was added as part of https://github.com/curl/curl/issues/4915.

This was originally added for SERVER-38493 but the libcurl concurrency issues were not discovered until after SERVER-38493 was complete.



 Comments   
Comment by Shane Harvey [ 04/Aug/21 ]

This only affects queryable restore.

As shown in SERVER-58161, this bug also affects OCSP stapling lookup.

Comment by Githook User [ 03/Mar/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-54139 Connection pool fixes for aws

(cherry picked from commit fca01d31762e9271cb5e710901b93ec65baee3b7)
Branch: v4.2
https://github.com/mongodb/mongo/commit/22f5f42812264a9863447c86ecb2202f5feae39e

Comment by Githook User [ 03/Mar/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-54139 Use a connection pool for curl handles

(cherry picked from commit 137bd47d9138fe9bbb0e1fc81dfbbce2cfd35a96)
Branch: v4.2
https://github.com/mongodb/mongo/commit/1e3803204cad03f72438df0613bfd87506755695

Comment by Githook User [ 02/Mar/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-54139 Remove CURL share support from HTTP curl client
Branch: v4.0
https://github.com/10gen/mongo-enterprise-modules/commit/e8126c9df28cdeb398b42a4af293150be8061c64

Comment by Githook User [ 01/Mar/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-54139 Connection pool fixes for aws

(cherry picked from commit fca01d31762e9271cb5e710901b93ec65baee3b7)
Branch: v4.4
https://github.com/mongodb/mongo/commit/2321dd90f708b380df4b0936bc5e8825e4346cd3

Comment by Githook User [ 01/Mar/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-54139 Use a connection pool for curl handles

(cherry picked from commit 137bd47d9138fe9bbb0e1fc81dfbbce2cfd35a96)
Branch: v4.4
https://github.com/mongodb/mongo/commit/93257282547170ba369f8415f113b9ba61a5fb1e

Comment by Githook User [ 01/Mar/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-54139 Connection pool fixes for aws
Branch: master
https://github.com/mongodb/mongo/commit/fca01d31762e9271cb5e710901b93ec65baee3b7

Comment by Githook User [ 23/Feb/21 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-54139 Use a connection pool for curl handles
Branch: master
https://github.com/mongodb/mongo/commit/137bd47d9138fe9bbb0e1fc81dfbbce2cfd35a96

Generated at Thu Feb 08 05:32:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.