Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(kds): clone resource on update meta #10460

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

jakubdyszkiewicz
Copy link
Contributor

Checklist prior to review

While this is a "bug" it was not a problem for the current code, because we never update synced resource.

I only discovered this after I added a component that takes synced resource from cached resource manager and tries to update it. The meta was wrong, because it was replaced on the cached resource.

xref #9031

No need to backport.

  • Link to relevant issue as well as docs and UI issues --
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as a image registry) and it will work on Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Tests (Unit test, E2E tests, manual test on universal and k8s) --
    • Don't forget ci/ labels to run additional/fewer tests
  • Do you need to update UPGRADE.md? --
  • Does it need to be backported according to the backporting policy? (this GH action will add "backport" label based on these file globs, if you want to prevent it from adding the "backport" label use no-backport-autolabel label) --

@jakubdyszkiewicz jakubdyszkiewicz requested a review from a team as a code owner June 13, 2024 13:28
@jakubdyszkiewicz jakubdyszkiewicz requested review from Automaat and lobkovilya and removed request for a team June 13, 2024 13:28
@jakubdyszkiewicz jakubdyszkiewicz enabled auto-merge (squash) June 13, 2024 13:41
@jakubdyszkiewicz jakubdyszkiewicz merged commit 3d506ed into kumahq:master Jun 13, 2024
15 checks passed
Copy link
Contributor

github-actions bot commented Nov 27, 2024

backporting to release-2.9 with action

backporting to release-2.8 with action
backporting to release-2.7 with action

kumahq bot pushed a commit that referenced this pull request Nov 27, 2024
kumahq bot pushed a commit that referenced this pull request Nov 27, 2024
lahabana pushed a commit that referenced this pull request Nov 27, 2024
While investigating the KDS code in the `release-2.7` branch, I noticed
that the resource is not cloned in `UpdateResourceMeta`. This issue was
fixed in releases >= 2.8, but it remains unresolved in 2.7. I'm not sure
if the fix fully addresses the issue, but it seems related

```yaml
unexpected fault address 0x0
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x1538f3b]

goroutine 5145 gp=0xc001cb5180 m=4 mp=0xc000100008 [running]:
...
github.com/kumahq/kuma/pkg/kds/context.DefaultContext.UpdateResourceMeta.func2(0xc0032183c0?, {0x4874b50, 0xc0013ff0e0})
```

```yaml
goroutine 45485 gp=0xc001005880 m=nil [runnable]:
...
github.com/kumahq/kuma/pkg/kds/context.DefaultContext.If.func15(0xc0047cb8c0, {0x4874b50, 0xc0016fbbd8})
```

in both goroutine `0x4874b50` is the meta address.

Automatic cherry-pick of #10460 for branch release-2.7

Generated by
[action](https://github.com/kumahq/kuma/actions/runs/12051462482)

cherry-picked commit 3d506ed

---------

Signed-off-by: Jakub Dyszkiewicz <[email protected]>
Signed-off-by: Lukasz Dziedziak <[email protected]>
Co-authored-by: Jakub Dyszkiewicz <[email protected]>
Co-authored-by: Lukasz Dziedziak <[email protected]>
lukidzi added a commit that referenced this pull request Nov 27, 2024
While investigating the KDS code in the `release-2.6` branch, I noticed
that the resource is not cloned in `UpdateResourceMeta`. This issue was
fixed in releases >= 2.8, but it remains unresolved in 2.6. I'm not sure
if the fix fully addresses the issue, but it seems related

```yaml
unexpected fault address 0x0
fatal error: fault
[signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x1538f3b]

goroutine 5145 gp=0xc001cb5180 m=4 mp=0xc000100008 [running]:
...
github.com/kumahq/kuma/pkg/kds/context.DefaultContext.UpdateResourceMeta.func2(0xc0032183c0?, {0x4874b50, 0xc0013ff0e0})
```

```yaml
goroutine 45485 gp=0xc001005880 m=nil [runnable]:
...
github.com/kumahq/kuma/pkg/kds/context.DefaultContext.If.func15(0xc0047cb8c0, {0x4874b50, 0xc0016fbbd8})
```

in both goroutine `0x4874b50` is the meta address.

Automatic cherry-pick of #10460 for branch release-2.6

Generated by
[action](https://github.com/kumahq/kuma/actions/runs/12051462482)

cherry-picked commit 3d506ed

---------

Signed-off-by: Jakub Dyszkiewicz <[email protected]>
Signed-off-by: Lukasz Dziedziak <[email protected]>
Co-authored-by: Jakub Dyszkiewicz <[email protected]>
Co-authored-by: Lukasz Dziedziak <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants