Skip to content

Optimistic cache may return wrong result once it meets ServFail #436

Closed as not planned
@BusyJay

Description

@BusyJay

Optimistic cache will return stale cache and trigger a background resolve to refresh the cache. Consider following timeline:

receive query -> resolve -> ServFail
receive query -> cache hit and return ServFail
                        |
                       -> resolve -> MXDOMAIN -> skip updating cache

If a query always returns MXDOMAIN generally, and somehow upstream returns a ServFail, it will be cached for 30 seconds and then become stale. However, when background retry sees MXDOMAIN, it will skip refresh cache, so all further request will be always responded by a stale cahched ServFail. Clients may retry ServFail and flood adguardhome with meaningless requests.

A simple fix is don't return any stale ServFail response from cache.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions