Operational Defect Database

BugZero found this defect 86 days ago.

MongoDB | 2587207

NetworkInterfaceTL can crash during destruction

Last update date:

3/8/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

8.0.0-rc0

Description:

Info

AsioReactor allows tasks to be scheduled even while/after it is stopped. Tasks scheduled during the dropping will be drained, but those scheduled after draining is complete will just never be executed. NetworkInterfaceTL schedules work on the reactor after making it a GuaranteedExecutor, so if the above case is ever hit, an invariant will be triggered during the destruction, as the submitted task was never scheduled. See BF-31784 for more context. To fix this, we can check to see if the reactor has been stopped in AsioReactor::schedule, and if so execute the task with a cancellation status, rather than posting it to the io_context. This is similar to other existing task executors: https://github.com/10gen/mongo/blob/master/src/mongo/executor/network_interface_thread_pool.cpp#L113-L118

Top User Comments

xgen-internal-githook commented on Fri, 8 Mar 2024 19:01:14 +0000: Author: {'name': 'James Bronsted', 'email': '32047428+jpbronsted@users.noreply.github.com', 'username': 'jpbronsted'} Message: SERVER-87037 guard against scheduling additional work after initial drain (#19397) GitOrigin-RevId: 64dca7eaed26da5ee7547e1d62be599a87678327 Branch: master https://github.com/mongodb/mongo/commit/8fc4819689899edbaf30157375b771dab8da86b6

Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Closed

Learn More

Search:

...