Skip to content

GrpcChannel - _methodInfoCache does not Work #2667

@marcprob

Description

@marcprob

In the class Grpc.Net.Client.GrpcChannel there is a ThreadSafeLookup<IMethod, GrpcMethodInfo> _methodInfoCache.

However, since Grpc.Core.Method does not provide an override for GetHashCode (or Equals), the cache never stores or retrieves entries correctly. This results in _methodInfoCache not caching anything as intended.

Expected behavior:
Grpc.Core.Method should override Equals and GetHashCode so that instances referring to the same method can be matched and cached properly.

Actual behavior:
Each Grpc.Core.Method instance is considered unique, even when referring to the same RPC method, causing unnecessary cache misses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions