Skip to content

Conversation

@cr7258
Copy link
Member

@cr7258 cr7258 commented Feb 20, 2025

Please provide a description of this PR:

原本的问题:
node.CachedListeners 的设计目的是减少 envoyfilter patch 操作的开销,它用于存储 patch 后的完整 Listener。然而,node.CachedListeners 构建的缓存可能会被错误地使用。例如,在下图中,step2 根据 key1 ~ key4 构建了 node.CachedListeners,当 step3 删除 key3 和 key4 时,由于 miss == 0(key1 和 key2 能匹配 step1),因此 step2 中构建的 node.CachedListeners 会直接被 step3 使用,导致使用了错误的缓存。

CleanShot 2025-02-20 at 22 39 50@2x

修复方法:
我把 envoyfilter patch 也放到 buildGatewayListeners 里了,这样加到 cache 的时候会把 patch 好的 Listener 加进去,就不用在node.CachedListeners 中再存一份了。
fixes: alibaba/higress#1774

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • Ambient
  • Configuration Infrastructure
  • Docs
  • Installation
  • Networking
  • Performance and Scalability
  • Policies and Telemetry
  • Security
  • Test and Release
  • User Experience
  • Developer Infrastructure

Please check any characteristics that apply to this pull request.

  • Does not have any user-facing changes. This may include CLI changes, API changes, behavior changes, performance improvements, etc.

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.

自定义应答不生效

1 participant