Conversation
在protobuf::message中使用递归哈希以避免转为字符串的开销,加入哈希缓存机制以减少envoy listener manager多次hash时重复计算,该优化对大量filter chain的场景非常有效 Change-Id: I1eeea1121a11a91478750290a573c569e2a25727
Change-Id: Id81142e2f0a14e4d884fbaf0222f56255d87d907
…the initial status code and target service information. Change-Id: I3e21b8a555f15adb85285006bfca643202ed67f7
Change-Id: I18431153fdc4d7b5b40ac1d7e10fe73240e2fa64
Change-Id: I247d12cc12c31f9e8d9e027d0f04af2fc37bf785
…rations Change-Id: Ie0930f4f1de7501447c3a420b476379b8787bb1e
Change-Id: I787f124bb7b1b35d7b9fecfa8fe6261fd52f413f
|
CodeReview流程已终止 |
There was a problem hiding this comment.
This PR is being reviewed by Cursor Bugbot
Details
Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| #if defined(HIGRESS) && defined(ENVOY_ENABLE_FULL_PROTOS) | ||
| class HashCachedMessageUtil : public MessageUtil { | ||
| public: | ||
| bool operator()(const Protobuf::Message& message) const { return message.GetCachedHashValue(); } |
There was a problem hiding this comment.
Bug: Hash Functor Returns Wrong Type, Catastrophic Collisions
The hash functor operator() in HashCachedMessageUtil returns bool instead of std::size_t. When used as the hash template parameter in absl::node_hash_map and absl::flat_hash_map, this causes the hash value to be implicitly converted to bool (0 or 1), resulting in catastrophic hash collisions where all messages hash to either 0 or 1, breaking hash map functionality.
| } else if (test == "RebuildTest") { | ||
| if (!getRequestHeader("rebuild")->toString().empty()) { | ||
| logInfo("Setting rebuild flag"); | ||
| setFilterState("wasm_rebuild", "true"); |
There was a problem hiding this comment.
Bug: Silent Wasm Rebuild Failure
The filter state key "wasm_rebuild" doesn't match the constant WasmRebuildKey defined as "wasm_need_rebuild" in source/extensions/common/wasm/context.cc. This mismatch prevents the rebuild flag from being detected, causing the rebuild feature to silently fail in tests and production.
Commit Message:
Additional Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]
Note
Introduce xxhash-based cached protobuf Message hashing and use it across Envoy (listener/maps/config hashing), plus HIGRESS-specific fixes/features including WASM VM proactive rebuild, end_stream handling, new stats, and minor HTTP/redirect tweaks.
google::protobuf::Messagewith cachedComputeHashValue()/GetCachedHashValue().HashCachedMessageUtiland switch various hash/equality maps to it (e.g.,FilterChainMatch,FilterChain, listener default FC comparison).ListenerManagerImpl, RDS RouteConfig hashing).PluginHandleSharedPtrThreadLocal::rebuild), newrebuild_totalstat, lower recover interval, and filter-state trigger (wasm_need_rebuild).plugin_vm_memoryproperty; tests for VM memory and proactive rebuild.end_streamconsistency when injecting data (setremote_decode_complete_/local_complete_).StreamInfowhen request headers pointer is null.GAUGE(last_update_success)to subscription stats; set in gRPC subscription (guarded by macro).Written by Cursor Bugbot for commit 45d3e7f. This will update automatically on new commits. Configure here.