Skip to content

Are traffic limiters working as intended? #73

Description

@jolfzverb

Hi!
I noticed that in my setup the traffic rate limiter does not work when it is set up at the service.handler level, but service level limiter seems to work fine.

I tried to analyze the issue and my current understanding is that the limiter is skipped because it has ScopeClient:

case limiter.ScopeClient:
return nil

case limiter.ScopeClient:
return nil

when I change initialization of the handler to use ScopeService here:

cache_limiter.ScopeOption(limiter.ScopeClient),

limiter.ScopeOption(limiter.ScopeClient),

it seems to fix the issue and limiter works correctly.

I'm not entirely sure that my analysis is correct and the solution would not break something else.

Can someone clarify what is the intended way to use this limiter, why does it have ScopeClient and why is it skipped in In and Out handlers?

I think I will continue to use ScopeService for my setup as it solves the issue and limits traffic correctly for now.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions