Skip to content

filter-state: make ProxyProtocolFilterState mutable#44308

Open
adisuissa wants to merge 3 commits intoenvoyproxy:mainfrom
adisuissa:make_proxy_protocol_filter_state_mutable
Open

filter-state: make ProxyProtocolFilterState mutable#44308
adisuissa wants to merge 3 commits intoenvoyproxy:mainfrom
adisuissa:make_proxy_protocol_filter_state_mutable

Conversation

@adisuissa
Copy link
Copy Markdown
Contributor

Commit Message: filter-state: make ProxyProtocolFilterState mutable
Additional Description:
When inserting a key-value to the filter-state, one needs to define whether that key-value is ReadOnly or Mutable.
In conn_manager_impl:188 the insertion using a ReadOnly mode, whereas in #42824, the tcp_proxy insertion was modified from ReadOnly to Mutable.
Modifying the conn_manager_impl to also be mutable, as the current state triggers [ENVOY_BUG] (

IS_ENVOY_BUG(fmt::format("FilterStateAccessViolation: FilterState accessed "
"immutable data as mutable: {}.",
).

Risk Level: low
Testing: N/A
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Adi Suissa-Peleg <adip@google.com>
@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #44308 was opened by adisuissa.

see: more, trace.

@adisuissa adisuissa marked this pull request as ready for review April 7, 2026 13:59
@adisuissa
Copy link
Copy Markdown
Contributor Author

Assigning @paul-r-gall who looked at this internally, and @agrawroh and @ggreenway who reviewed #42824
/assign @paul-r-gall @agrawroh @ggreenway

@ggreenway
Copy link
Copy Markdown
Member

Should we remove this setting from filter-state and just make everything mutable? Are we getting any value from the read-only setting? It feels like it only leads to bugs like this.

ggreenway
ggreenway previously approved these changes Apr 7, 2026
Signed-off-by: Adi Suissa-Peleg <adip@google.com>
@adisuissa
Copy link
Copy Markdown
Contributor Author

Should we remove this setting from filter-state and just make everything mutable? Are we getting any value from the read-only setting? It feels like it only leads to bugs like this.

That is an excellent question that I've asked myself, but I don't have sufficient context.
My guess was that this "complexity" was added for a reason, or otherwise just a mutable get/set would have been supported.

@ggreenway
Copy link
Copy Markdown
Member

Should we remove this setting from filter-state and just make everything mutable? Are we getting any value from the read-only setting? It feels like it only leads to bugs like this.

That is an excellent question that I've asked myself, but I don't have sufficient context. My guess was that this "complexity" was added for a reason, or otherwise just a mutable get/set would have been supported.

I was there when this discussion was made. The mutable/read-only was added because someone feared that not adding it could lead to difficulties understanding where changes to the data were made. I never thought it was a strong argument. I don't recall who it was, but it was not one of the maintainers who insisted on it. I think I'll take a shot at removing it; we can discuss further in the comments on that PR when I post it.

@ggreenway
Copy link
Copy Markdown
Member

@adisuissa I just posted #44343 which removes the checks.

…_filter_state_mutable

Signed-off-by: Adi Suissa-Peleg <adip@google.com>
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.

4 participants