[SERVER-45261] create more state in NiTL ctor Created: 19/Dec/19  Updated: 29/Oct/23  Resolved: 14/Jan/20

Status: Closed
Project: Core Server
Component/s: Networking
Affects Version/s: None
Fix Version/s: 4.2.4, 4.3.3

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

Issue Links:
Backports
Duplicate
is duplicated by SERVER-47541 mongod segfaults during mongot e2e tests Closed
Related
related to SERVER-47541 mongod segfaults during mongot e2e tests Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2
Sprint: Service Arch 2019-12-30, Service Arch 2020-01-13, Service Arch 2020-01-27
Participants:

 Description   

Calls to NetworkInterfaceTL::startCommand() before NetworkInterfaceTL::startup() wil cause crashes (due to an assumption inside NetworkInterfaceTL::startCommand() that we have a connection pool.

That's out of contract for a NetworkInterface

    /**
     * Starts up the network interface.
     *
     * It is valid to call all methods except shutdown() before this method completes.  That is,
     * implementations may not assume that startup() completes before startCommand() first
     * executes.
     *
     * Called by the owning TaskExecutor inside its run() method.
     */
    virtual void startup() = 0;

To fix that, lets create more state on the NiTL in it's ctor, and only spin up the background thread in startup().



 Comments   
Comment by Githook User [ 07/Feb/20 ]

Author:

{'name': 'Jason Carey', 'username': 'hanumantmk', 'email': 'jason.carey@mongodb.com'}

Message: SERVER-45261 create more state in NiTL ctor

Calls to NetworkInterfaceTL::startCommand() before
NetworkInterfaceTL::startup() wil cause crashes (due to an assumption
inside NetworkInterfaceTL::startCommand() that we have a connection
pool.

That's out of contract for a NetworkInterface

To fix that, lets create more state on the NiTL in it's ctor, and only
spin up the background thread in startup().

(cherry picked from commit 1878d44a2ac3764d71f00e8ce04ecb9911ab6023)
Branch: v4.2
https://github.com/mongodb/mongo/commit/8fff4e62942df3b88df4b60cbddc1137530d203c

Comment by Githook User [ 14/Jan/20 ]

Author:

{'name': 'Jason Carey', 'email': 'jason.carey@mongodb.com', 'username': 'hanumantmk'}

Message: SERVER-45261 create more state in NiTL ctor

Calls to NetworkInterfaceTL::startCommand() before
NetworkInterfaceTL::startup() wil cause crashes (due to an assumption
inside NetworkInterfaceTL::startCommand() that we have a connection
pool.

That's out of contract for a NetworkInterface

To fix that, lets create more state on the NiTL in it's ctor, and only
spin up the background thread in startup().
Branch: master
https://github.com/mongodb/mongo/commit/1878d44a2ac3764d71f00e8ce04ecb9911ab6023

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