Skip to content

refactor/perf: use LuaPerRoute instead of FilterConfig - #8355

Merged
rudrakhp merged 1 commit into
envoyproxy:mainfrom
rudrakhp:lua_per_route
Mar 8, 2026
Merged

rudrakhp merged 1 commit into
envoyproxy:mainfrom
rudrakhp:lua_per_route

Conversation

@rudrakhp

@rudrakhp rudrakhp commented Feb 26, 2026 •

Copy link
Copy Markdown
Member

What type of PR is this?
refactor/perf: use LuaPerRoute instead of FilterConfig

What this PR does / why we need it:

Helps reduce listener drain due to Lua policy churn as they are applied at routes now. Lua E2E and tests are already in place.

Fixes #7839

Release Notes: Yes

@netlify

netlify Bot commented Feb 26, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cerulean-figolla-1f9435 canceled.

Name Link
🔨 Latest commit 12dc49d
🔍 Latest deploy log https://app.netlify.com/projects/cerulean-figolla-1f9435/deploys/69ad0c1d61deaf00088d38a5

@codecov

codecov Bot commented Feb 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.25000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.17%. Comparing base (b0638d5) to head (12dc49d).
⚠️ Report is 61 commits behind head on main.

Files with missing lines Patch % Lines
internal/xds/translator/lua.go 81.25% 1 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8355   +/-   ##
=======================================
  Coverage   74.17%   74.17%           
=======================================
  Files         242      242           
  Lines       37563    37575   +12     
=======================================
+ Hits        27863    27872    +9     
- Misses       7763     7764    +1     
- Partials     1937     1939    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rudrakhp
rudrakhp marked this pull request as ready for review February 26, 2026 13:27
@rudrakhp
rudrakhp requested a review from a team as a code owner February 26, 2026 13:27
@rudrakhp
rudrakhp requested a review from zhaohuabing February 26, 2026 13:28
@@ -15,26 +15,17 @@
maxConcurrentStreams: 100
httpFilters:
- disabled: true
name: envoy.filters.http.lua/envoyextensionpolicy/default/policy-for-http-route/lua/0
name: envoy.filters.http.lua/0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we keep the naming? Changing Lua filter names from policy-derived names to positional names breaks the existing identity contract.

  • The new name would break EEP/Extension Manager
  • The numbered name making them difficult to be used in EEP/Extension Manager
  • It's not aligned with other filter names generated by policies

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@zhaohuabing the reason for keeping the name policy/route agnostic is so that listener filter chain drain will not happen that frequently. I was not aware the extension naming was a contract we expose for others to use. If that's the case, we will have to live with listener filter chain updates ig.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, I get the rational. But this is a breaking change and the likelihood of chain drain due to filter name change is much lower than the lua script change, so I'd prefer keeping the original name

@rudrakhp
rudrakhp force-pushed the lua_per_route branch 2 times, most recently from 418c61f to db46c16 Compare March 2, 2026 12:07
@rudrakhp
rudrakhp requested a review from zhaohuabing March 2, 2026 12:08
zhaohuabing
zhaohuabing previously approved these changes Mar 3, 2026

@zhaohuabing zhaohuabing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thanks!

@@ -19,22 +19,19 @@
typedConfig:
'@type': type.googleapis.com/envoy.extensions.filters.http.lua.v3.Lua
defaultSourceCode:
inlineString: function envoy_on_request(request_handle) request_handle:logInfo('Goodbye.')
end
inlineString: ""

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this required? if so, let's make a change to upstream make it optional.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It doesn't make sense to make it optional IMO, also the filter is disabled so its a no-op anyways?

@kkk777-7

kkk777-7 commented Mar 6, 2026

Copy link
Copy Markdown
Member

/retest

@rudrakhp
rudrakhp force-pushed the lua_per_route branch 2 times, most recently from ea960a5 to 210f68b Compare March 7, 2026 06:40
@arkodg
arkodg requested review from zhaohuabing and zirain March 7, 2026 21:40
@rudrakhp

rudrakhp commented Mar 8, 2026

Copy link
Copy Markdown
Member Author

/retest

@rudrakhp
rudrakhp merged commit f31ac4e into envoyproxy:main Mar 8, 2026
0 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Lua filters to built in per route filters

5 participants