From aa5588c9112b02ec18994e2fabacc3d460c6b5fd Mon Sep 17 00:00:00 2001 From: "Hyunji Choi (SWE)" Date: Sun, 24 Sep 2023 09:08:28 -0700 Subject: [PATCH] Log stream ID limit exceeded error in Liger Summary: We are seeing more stream ID limit exceeded errors in MNS. Liger does not show this error because it silently fallback to TCP without raising QUIC error in this case. We want to confirm if Liger never fails to open QUIC stream or it is just hided. Differential Revision: D49188887 fbshipit-source-id: 21434e252838c39d6fa304dd251deae20421dd75 --- proxygen/lib/http/session/HQSession.cpp | 2 ++ proxygen/lib/http/session/HTTPSessionBase.h | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/proxygen/lib/http/session/HQSession.cpp b/proxygen/lib/http/session/HQSession.cpp index 21614f26d4..b06b3555c5 100644 --- a/proxygen/lib/http/session/HQSession.cpp +++ b/proxygen/lib/http/session/HQSession.cpp @@ -2194,6 +2194,7 @@ void HQSession::HQStreamTransportBase::initIngress(const std::string& where) { HTTPTransaction* FOLLY_NULLABLE HQSession::newTransaction(HTTPTransaction::Handler* handler) { VLOG(4) << __func__ << " sess=" << *this; + setStreamLimitExceeded(false); if (drainState_ == DrainState::CLOSE_SENT || drainState_ == DrainState::FIRST_GOAWAY || @@ -2210,6 +2211,7 @@ HQSession::newTransaction(HTTPTransaction::Handler* handler) { auto quicStreamId = sock_->createBidirectionalStream(); if (!quicStreamId) { VLOG(2) << __func__ << " failed to create new stream: " << this; + setStreamLimitExceeded(true); return nullptr; } diff --git a/proxygen/lib/http/session/HTTPSessionBase.h b/proxygen/lib/http/session/HTTPSessionBase.h index 58ca5f45c2..01654eeb6e 100644 --- a/proxygen/lib/http/session/HTTPSessionBase.h +++ b/proxygen/lib/http/session/HTTPSessionBase.h @@ -360,6 +360,10 @@ class HTTPSessionBase : public wangle::ManagedConnection { return transactionSeqNo_; } + [[nodiscard]] bool getStreamLimitExceeded() const { + return streamLimitExceeded_; + } + [[nodiscard]] std::chrono::seconds getLatestIdleTime() const /*override*/ { DCHECK_GT(transactionSeqNo_, 0u) << "No idle time for the first transaction"; @@ -629,6 +633,10 @@ class HTTPSessionBase : public wangle::ManagedConnection { ++transactionSeqNo_; } + void setStreamLimitExceeded(bool streamLimitExceeded) { + streamLimitExceeded_ = streamLimitExceeded; + } + void onNewOutgoingStream(uint32_t outgoingStreams) { if (outgoingStreams > historicalMaxOutgoingStreams_) { historicalMaxOutgoingStreams_ = outgoingStreams; @@ -823,6 +831,11 @@ class HTTPSessionBase : public wangle::ManagedConnection { * Indicates whether Ex Headers is supported in HTTPSession */ bool exHeadersEnabled_ : 1; + + /** + * Indicates whether quic stream ID limit is exceeded. + */ + bool streamLimitExceeded_{false}; }; } // namespace proxygen