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

Facilitate OPA decision correlation with business flows #3160

Conversation

JanardhanSharma
Copy link
Collaborator

@JanardhanSharma JanardhanSharma commented Jul 22, 2024

Context

The release of the feature Facilitate OPA decision correlation with business flows (PR) led to bug that leads to the skipper restarts. This is because an object of same reference is being shared among the different instances of opa instances.

Error log from the reported bug (for those who cannot access the bug details):

goroutine 191993 [running]:
github.com/zalando/skipper/filters/openpolicyagent.setDecisionIdInRequest(0x4004494720, {0x40067c6440?, 0x10?})
github.com/zalando/skipper/filters/openpolicyagent/evaluation.go:92 +0xe4
github.com/zalando/skipper/filters/openpolicyagent.(*OpenPolicyAgentInstance).Eval(0x40059ef400, {0x16b6bb0, 0x40044946c0}, 0x4004494720)
github.com/zalando/skipper/filters/openpolicyagent/evaluation.go:27 +0x164
github.com/zalando/skipper/filters/openpolicyagent/opaauthorizerequest.(*opaAuthorizeRequestFilter).Request(0x4002234520, {0x16ccd90, 0x40091ca100})
github.com/zalando/skipper/filters/openpolicyagent/opaauthorizerequest/opaauthorizerequest.go:131 +0x1a4
github.com/zalando/skipper/proxy.(*Proxy).applyFiltersToRequest(0x4003510500, {0x40053e9a40, 0x7, 0x10d1400?}, 0x40091ca100)
github.com/zalando/skipper/proxy/proxy.go:895 +0x248
github.com/zalando/skipper/proxy.(*Proxy).do(0x4003510500, 0x40091ca100, {0x16c8360, 0x400174d810})
github.com/zalando/skipper/proxy/proxy.go:1216 +0x5a0
github.com/zalando/skipper/proxy.(*Proxy).ServeHTTP(0x4003510500, {0x16b33f0, 0x4001d6fdc0}, 0x4003126480)
github.com/zalando/skipper/proxy/proxy.go:1610 +0x648
github.com/zalando/skipper/net.(*ForwardedHeadersHandler).ServeHTTP(0x4001426640, {0x16b33f0, 0x4001d6fdc0}, 0x4003126000)
github.com/zalando/skipper/net/headers.go:77 +0x114
github.com/zalando/skipper/net.(*HostPatchHandler).ServeHTTP(0x4004cc3920, {0x16b33f0, 0x4001d6fdc0}, 0x4003126000)
github.com/zalando/skipper/net/host.go:60 +0x84
github.com/zalando/skipper/net.(*RequestMatchHandler).ServeHTTP(0x4000f7e8d0, {0x16b33f0, 0x4001d6fdc0}, 0x4003126000)
github.com/zalando/skipper/net/request.go:20 +0xb0
net/http.serverHandler.ServeHTTP({0x40044943f0?}, {0x16b33f0?, 0x4001d6fdc0?}, 0x6?)
net/http/server.go:3137 +0xbc
net/http.(*conn).serve(0x4007109050, {0x16b6bb0, 0x4000f7ec00})
net/http/server.go:2039 +0x508
created by net/http.(*Server).Serve in goroutine 1
net/http/server.go:3285 +0x3f0

ACs

Fix the opaauhorizerequest filter restart issue.

fixes #3179

@JanardhanSharma
Copy link
Collaborator Author

@AlexanderYastrebov @mjungsbluth @szuecs If we could merge this it will be nice, I am on vacation this week, once I am back I have a feeling I will get a lot of merge conflicts :D

@AlexanderYastrebov
Copy link
Member

Please squash all commits and add commit message describing the change (think like #3041 was never merged)

Signed-off-by: JanardhanSharma <janardhan.sharma@outlook.com>
@JanardhanSharma JanardhanSharma force-pushed the facilitate-OPA-decision-correlation-with-business-flows-iteration-0 branch from 3199a55 to 93f4e9e Compare July 23, 2024 11:40
@JanardhanSharma
Copy link
Collaborator Author

Please squash all commits and add commit message describing the change (think like #3041 was never merged)

done.

@AlexanderYastrebov
Copy link
Member

AlexanderYastrebov commented Jul 23, 2024

Please squash all commits and add commit message describing the change (think like #3041 was never merged)

done.

Commit message is empty, otherwise lgtm.

@AlexanderYastrebov
Copy link
Member

👍

@JanardhanSharma
Copy link
Collaborator Author

@szuecs could you please oblige with a thumbs up

@MustafaSaber
Copy link
Member

MustafaSaber commented Jul 31, 2024

hi @JanardhanSharma, I think we can merge, but it would be nice to have performance tests to understand the impact before and after. Maybe in a follow up PR?

I will add my +1 once you confirm

@JanardhanSharma
Copy link
Collaborator Author

hi @JanardhanSharma, I think we can merge, but it would be nice to have performance tests to understand the impact before and after. Maybe in a follow up PR?

I will add my +1 once you confirm

Thanks @MustafaSaber. Yes I will create a subsequent ticket in the backlog for the test case as well.

@MustafaSaber
Copy link
Member

👍

@MustafaSaber MustafaSaber merged commit 7d28a91 into master Aug 1, 2024
17 checks passed
@MustafaSaber MustafaSaber deleted the facilitate-OPA-decision-correlation-with-business-flows-iteration-0 branch August 1, 2024 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugfix Bug fixes and patches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OPA: fatal error: concurrent map writes
3 participants