cmcfarlen commented on code in PR #13406:
URL: https://github.com/apache/trafficserver/pull/13406#discussion_r3715525264
##########
plugins/experimental/rate_limit/sni_selector.cc:
##########
@@ -22,6 +22,13 @@
std::atomic<SniSelector *> SniSelector::_instance = nullptr;
+// The VC user-arg index, defined in sni_limiter.cc, used to detach an expired
queued VC.
+extern int gVCIdx;
+
+// Shared lock (defined in sni_limiter.cc) serializing the queue/slot
transactions below
+// against the net-thread VCONN_CLOSE handler.
+extern std::mutex gQueueMutex;
Review Comment:
Could the lock be per-limiter instead of global?
##########
plugins/experimental/rate_limit/limiter.h:
##########
@@ -327,6 +327,25 @@ template <class T> class RateLimiter
return item;
}
+ // Remove a still-queued element (e.g. a connection that closed before it
was resumed).
+ // Returns true if it was found in the queue, so the caller can tell a
queued element
+ // (which never reserved a slot) from one that was already resumed.
+ bool
+ remove(T elem)
+ {
+ std::lock_guard<std::mutex> lock(_queue_lock);
+
+ for (auto it = _queue.begin(); it != _queue.end(); ++it) {
Review Comment:
how big can queue get?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]