Add an LRU cache to limit the frequency of logging client metadata

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Fixed
    • Priority: Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Service Arch
    • Fully Compatible
    • Service Arch 2023-03-06
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      ClientCache implements an LRU cache and acts as the gatekeeper for logging client metadata for incoming gRPC streams. This ticket focuses on using the existing LRUCache to implement a thread-safe ClientCache, where:

      • The constructor forwards the maximum cache size to the constructor of LRUCache. By default, we will set this to 65,536, reserving about 1 MB of memory for the cache.
      • The add method inserts clientId into the underlying cache:
      • If the clientId already exists, the cache is updated and the add method returns false.
      • Otherwise, it returns true.
      class ClientCache {
      	explicit ClientCache(size_t maxSize);
      	bool add(const UUID& clientId) = 0;
      };
      

            Assignee:
            Patrick Freed
            Reporter:
            Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: