-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Internal Code
-
Networking & Observability
-
37
-
4
The transport layer utilizes ASIO reactors to perform networking operations. Such operations include but are not limited to DNS resolution and connection establishment.
Below is an example of using the reactors to perform asynchronous DNS resolution, where _resolver, which is an instance of resolver::async_resolve, schedules a request to resolve peer.host() on a networking reactor:
Future<EndpointVector> _asyncResolve(const HostAndPort& peer, Flags flags, bool enableIPv6) { auto port = std::to_string(peer.port()); Future<Results> ret; if (enableIPv6) { ret = _resolver.async_resolve(peer.host(), port, flags, UseFuture{}); } else { ret = _resolver.async_resolve(asio::ip::tcp::v4(), peer.host(), port, flags, UseFuture{}); } return std::move(ret).onError([this, peer](Status status) { return _checkResults(status, peer); }).then([this, peer](Results results) { return _makeFuture(results, peer); }); }
The goal is to collect more information on tasks ran by the reactor threads. At a minimum, we'd want to collect the duration of tasks ran by the reactor. It'd also be useful to measure the cost of running the continuations chained to tasks scheduled on reactor threads (e.g., see here).
Reporting these metrics in serverStatus (and FTDC) can help with diagnosing slow DNS resolutions and large delays in connection establishment.
Acceptance criteria: Report a histogram of each stage in connection establishment and success and failure statistics for each stage.
- related to
-
SERVER-59858 Add observability for tasks scheduled on the reactor thread
- Closed