Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TT-2380] - (hybrid) use singleflight when Recreating session for key #2620

Open
asoorm opened this issue Oct 15, 2019 · 2 comments
Open

[TT-2380] - (hybrid) use singleflight when Recreating session for key #2620

asoorm opened this issue Oct 15, 2019 · 2 comments

Comments

@asoorm
Copy link
Member

asoorm commented Oct 15, 2019

Branch/Environment/Version

all

Describe the bug

[Oct 15 00:07:44]  INFO Recreating session for key: ****8e86 api_id=60c036eea7a842b3728ca493a228b83f api_name=httpbin mw=AuthKey org_id=5bffbf8ef461e30001136627 origin=172.18.0.1 path=/httpbin/get
[Oct 15 00:07:44]  INFO Recreating session for key: ****8e86 api_id=60c036eea7a842b3728ca493a228b83f api_name=httpbin mw=AuthKey org_id=5bffbf8ef461e30001136627 origin=172.18.0.1 path=/httpbin/get
[Oct 15 00:07:44]  INFO Recreating session for key: ****8e86 api_id=60c036eea7a842b3728ca493a228b83f api_name=httpbin mw=AuthKey org_id=5bffbf8ef461e30001136627 origin=172.18.0.1 path=/httpbin/get
[Oct 15 00:07:44]  INFO Recreating session for key: ****8e86 api_id=60c036eea7a842b3728ca493a228b83f api_name=httpbin mw=AuthKey org_id=5bffbf8ef461e30001136627 origin=172.18.0.1 path=/httpbin/get
[Oct 15 00:07:44]  INFO Recreating session for key: ****8e86 api_id=60c036eea7a842b3728ca493a228b83f api_name=httpbin mw=AuthKey org_id=5bffbf8ef461e30001136627 origin=172.18.0.1 path=/httpbin/get
[Oct 15 00:07:44]  INFO Recreating session for key: ****8e86 api_id=60c036eea7a842b3728ca493a228b83f api_name=httpbin mw=AuthKey org_id=5bffbf8ef461e30001136627 origin=172.18.0.1 path=/httpbin/get
...
...

What happens:

API key does not exist in hybrid cluster of gateways. Hybrid Gateway calls MDCB to obtain the API key. Under high RPS, multiple calls to MDCB occur for the same information in parallel. This is particularly problematic when client is using incorrect credentials.

What should happen:

A single call in-flight to the hybrid layer at a given point in time for given api key would be a more efficient solution. especially in the case of the key not being found or if the api key is being used at a high RPS.

https://godoc.org/golang.org/x/sync/singleflight

@stale
Copy link

stale bot commented Mar 25, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, please add comments to this ticket if you would like it to stay open. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 25, 2020
@asoorm
Copy link
Member Author

asoorm commented Mar 29, 2020

not stale

@stale stale bot removed the wontfix label Mar 29, 2020
@vverbani vverbani changed the title (hybrid) use singleflight when Recreating session for key [TT-2380] - (hybrid) use singleflight when Recreating session for key Apr 28, 2021
@vverbani vverbani added zendesk and removed bug labels Apr 28, 2021
@andyo-tyk andyo-tyk added monitor-squad Monitor squad platform-squad and removed monitor-squad Monitor squad labels Apr 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants