Skip to content

[Task] Deprecate unused MemorySafeLRUMap and plan compatibility-aware removal #7444

Closed

Description

@Aias00

Background

MemorySafeLRUMap remains in shenyu-common, but a repository-wide reference search at master commit 67596c1d228b62da75cd0a0ecb47d0ac5d995384 finds only its declaration and dedicated tests. There are no repository-local production callers or configuration references.

This is a maintenance simplification opportunity: the class retains an additional non-thread-safe cache implementation and public constructors without serving the current runtime. It is not a measured runtime performance improvement.

Location

Proposed Scope

  • Assess whether downstream consumers still use this public shenyu-common API.
  • If compatibility requires it, deprecate the class with a release note and document migration before a later removal.
  • If removal is allowed by the project's compatibility policy, remove the implementation and its dedicated tests together.
  • Retain the active WindowTinyLFUMap implementation.
  • Keep MemoryLimitCalculator and commons-collections4 unless a separate dependency/reference analysis proves they can be removed; repository-local non-use of this one class is insufficient evidence.
  • Avoid adding a replacement cache abstraction for a class with no current production callers.

Verification

rg -n 'MemorySafeLRUMap' -g '!**/target/**'
./mvnw test -pl shenyu-common

Also inspect non-Java/reflection/config references and run the affected module's Checkstyle and RAT checks when implementing the change.

Acceptance Criteria

  • Downstream/public API compatibility has been considered explicitly.
  • The class is deprecated with migration guidance, or removed at a release where that API removal is acceptable.
  • Dedicated tests are retained for deprecation or removed with the class.
  • Active cache and memory-limit behavior remains unchanged.
  • No replacement abstraction or unjustified dependency removal is introduced.

Validation And Related Issues

Severity: Low. Confidence: high for repository-local non-use; downstream use remains unknown.

An independent reviewer confirmed the reference search. Targeted UriUtilsTest,MemorySafeLRUMapTest execution passed 7 tests with zero failures.

#7309 and #7377 removed the different unused MemorySafeWindowTinyLFUMap implementation. Their scope did not include MemorySafeLRUMap. #4020 discusses historical LRU cache usage and does not establish a present production caller for this class. Searches across open/closed issues found no current retirement task for MemorySafeLRUMap.

Activity

  1. github-actions commented on Oct 6, 2026

    @github-actions
    Contributor

    👋 Hello @yuluo-yx

    A new issue has been opened by @Aias00:

    Please review when you have time. Thank you! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions