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

change: make lrucache lock optional #2575

Merged
merged 2 commits into from
Nov 2, 2020
Merged

Conversation

spacewander
Copy link
Member

@spacewander spacewander commented Oct 30, 2020

What this PR does / why we need it:

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible?

Close #2520

@spacewander spacewander marked this pull request as ready for review October 31, 2020 14:42
Copy link
Member

@membphis membphis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, except for the name style thing

apisix/core/lrucache.lua Outdated Show resolved Hide resolved
@moonming moonming merged commit bf44ed1 into apache:master Nov 2, 2020

if stale_obj and stale_obj.ver == version then
lru_global:set(key, stale_obj, PLUGIN_TTL)
return stale_obj
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we need to return stale_obj.val instead. Otherwise, the returned value will be:

ver = xxx,
val = actual_cache_obj,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: "failed to acquire the lock: timeout" in logs/error.log when setuping route at the first time
3 participants