Investigate large delays in connection establishment

XMLWordPrintableJSON

    • Service Arch
    • ALL
    • 0
    • 6
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The following is a snippet from SpecificPool::spawnConnections that spawns new connections for connection pools:

      // spawn enough connections to satisfy open requests and minpool, while honoring maxpool
      void ConnectionPool::SpecificPool::spawnConnections() {
          ...
          for (decltype(allowance) i = 0; i < allowance; ++i) {
              OwnedConnection handle;
              try {
                  handle = _parent->_factory->makeConnection(_hostAndPort, _sslMode, _generation);
              } catch (std::system_error& e) {
                  ...
              }
              ...
              handle->setup(_parent->_controller->pendingTimeout(),
                            guardCallback([this](auto conn, auto status) {
                                finishRefresh(std::move(conn), std::move(status));
                            }),
                            _parent->getName());
          }
      }
      

      This ticket should investigate (and fix) the underlying cause for sporadic large delays (more than 50 milliseconds) in connection establishment.

      This delay can be measured by capturing current time (e.g., using _parent->_factory->now()) before calling into TLConnection::setup and before running the callback function.

              Assignee:
              [DO NOT USE] Backlog - Service Architecture
              Reporter:
              Amirsaman Memaripour
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: