Skip to content

Fix crash in merging http routes#56499

Merged
istio-testing merged 3 commits intoistio:masterfrom
howardjohn:pilot/fix-name-crash
Jun 4, 2025
Merged

Fix crash in merging http routes#56499
istio-testing merged 3 commits intoistio:masterfrom
howardjohn:pilot/fix-name-crash

Conversation

@howardjohn
Copy link
Copy Markdown
Member

@howardjohn howardjohn commented Jun 3, 2025

Fixes #56456

The issue here is due to how the collection is setup, we can have 2 input keys mapping to 1 output key. This corrupts krt's internal state. In order to catch this, I added assertions to krt: #56510.

The reason this happens is the input key is the merge key, so the hostname. The output key is the first object with the hostname. So if the hostname changes from host1 to host2, both of these map to the same object. Depending on the exact order of event processing this can lead to corrupted state, missing items, etc.

The solution is to include the key in the output. The output is config.config which already has a key of 'namespace/name'. I attempted a clean way to add an additional key (#56510) but it fell apart. We could make the collection not a config.config but that is a pain. Instead, I opted to set the name to the merge key. I think this is better anyways, since it is kind of weird to use an arbitrary object as the name. The name doesn't really matter though.

Note: we use the merge in other places but already do it safely.

@howardjohn howardjohn added the release-notes-none Indicates a PR that does not require release notes. label Jun 3, 2025
@istio-testing
Copy link
Copy Markdown
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@istio-testing istio-testing added do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 3, 2025
@howardjohn
Copy link
Copy Markdown
Member Author

/ok-to-test

@istio-testing istio-testing added the ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. label Jun 3, 2025
@howardjohn howardjohn changed the title WIP: fix crash in merging http routes Fix crash in merging http routes Jun 4, 2025
@howardjohn howardjohn marked this pull request as ready for review June 4, 2025 16:42
@howardjohn howardjohn requested a review from a team as a code owner June 4, 2025 16:42
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Jun 4, 2025
@howardjohn howardjohn added the cherrypick/release-1.26 Set this label on a PR to auto-merge it to the release-1.26 branch label Jun 4, 2025
@istio-testing
Copy link
Copy Markdown
Collaborator

@howardjohn: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
integ-ambient-mc_istio 21a2715 link false /test integ-ambient-mc
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link
Copy Markdown
Contributor

@ilrudie ilrudie left a comment

Choose a reason for hiding this comment

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

LGTM

@istio-testing istio-testing merged commit ad33cdc into istio:master Jun 4, 2025
29 of 30 checks passed
@istio-testing
Copy link
Copy Markdown
Collaborator

In response to a cherrypick label: new pull request created: #56517

fjglira pushed a commit to fjglira/istio that referenced this pull request Sep 26, 2025
* upstream/master: (28 commits)
  Automator: update common-files@master in istio/istio@master (istio#56545)
  Automator: update proxy@master in istio/istio@master (istio#56544)
  Automator: update go-control-plane in istio/istio@master (istio#56543)
  Automator: update proxy@master in istio/istio@master (istio#56540)
  Automator: update ztunnel@master in istio/istio@master (istio#56532)
  Ambient: In ambient index, filter configs by revision (istio#56477)
  Automator: update istio/client-go@master dependency in istio/istio@master (istio#56539)
  Automator: update proxy@master in istio/istio@master (istio#56538)
  Automator: update common-files@master in istio/istio@master (istio#56537)
  optimization: allow for lazy sidecar initialization (istio#47221)
  static collection eager indexes (istio#56530)
  fix typo in flag (istio#56534)
  feat: enable support for proxy protocol on status port (istio#55986)
  remove finding of pods by IP (istio#56502)
  Automator: update proxy@master in istio/istio@master (istio#56528)
  migrate file monitor to krt (istio#55970)
  Automator: update istio/client-go@master dependency in istio/istio@master (istio#56525)
  Automator: update ztunnel@master in istio/istio@master (istio#56518)
  Fix crash in merging http routes (istio#56499)
  krt: add assertions (istio#56510)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherrypick/release-1.26 Set this label on a PR to auto-merge it to the release-1.26 branch ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. release-notes-none Indicates a PR that does not require release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

modifying httpRoute crd cause istiod segfault

3 participants