[SERVER-58105] Improve exception handling in ASIOSession::end() Created: 25/Jun/21  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Amirsaman Memaripour Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: sa-remove-fv-backlog-22
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-58204 Instrumentation for socket lifecycle ... Closed
is related to SERVER-57639 Decrease the amount of logs emitted w... Closed
Assigned Teams:
Service Arch
Participants:

 Description   

Any exception thrown while ending an ASIO session is currently absorbed by a log statement and never returned to the caller:

void end() override {
    if (getSocket().is_open()) {
        std::error_code ec;
        getSocket().shutdown(GenericSocket::shutdown_both, ec);
        if ((ec) && (ec != asio::error::not_connected)) {
            LOGV2_ERROR(23841, "Error shutting down socket: {error}", "Error shutting down socket", "error"_attr = ec.message());
        }
    }
}

We should investigate alternatives to improve handling of exceptions.


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