You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "AlinsRan (via GitHub)" <gi...@apache.org> on 2026/06/22 06:07:11 UTC
[PR] fix(oas-validator): negatively cache spec_url fetch failures [apisix]
AlinsRan opened a new pull request, #13585:
URL: https://github.com/apache/apisix/pull/13585
### Description
When `oas-validator` loads the OpenAPI spec from `spec_url`, a fetch/compile failure was **not cached**. A persistently failing `spec_url` (remote down, non-200, invalid JSON) therefore triggered an **outbound HTTP request on every incoming request** — failure amplification that piles up connections and latency during an outage.
This adds `neg_ttl` / `neg_count` to the spec lru cache so failures are cached for a short window (5s). `core.lrucache` checks the negative cache before invoking the fetch, so repeated requests return the cached error without re-fetching, while a recovered `spec_url` is still picked up within 5s. The route still returns 500 on failure — only the redundant outbound fetches are eliminated.
### Tests
`t/plugin/oas-validator3.t` TEST 24/25: a route whose `spec_url` always returns 404 is hit 3 times; a shared-dict counter on the spec endpoint asserts it was fetched once.
### Checklist
- [x] I have explained the need for this PR and the problem it solves
- [x] I have explained the changes or the new features added to this PR
- [x] I have added tests corresponding to this change
- [x] I have updated the documentation to reflect this change (N/A — internal caching, no config/behavior change)
- [x] I have verified that this change is backward compatible
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(oas-validator): negatively cache spec_url fetch failures [apisix]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #13585: fix(oas-validator): negatively cache spec_url fetch failures
URL: https://github.com/apache/apisix/pull/13585
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(oas-validator): negatively cache spec_url fetch failures [apisix]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13585:
URL: https://github.com/apache/apisix/pull/13585#issuecomment-5379687069
This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 4 weeks if no further activity occurs. If you think that's incorrect or this pull request should instead be reviewed, please simply write any comment. Even if closed, you can still revive the PR at any time or discuss it on the dev@apisix.apache.org list. Thank you for your contributions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(oas-validator): negatively cache spec_url fetch failures [apisix]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #13585:
URL: https://github.com/apache/apisix/pull/13585#issuecomment-5749155408
This pull request/issue has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org