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

add streaming support for kratos recovery middleware #120

Merged
merged 2 commits into from
Jul 18, 2024

Conversation

lennysgarage
Copy link
Contributor

@lennysgarage lennysgarage commented Jul 17, 2024

PR Template:

Describe your changes

  • Adds a recovery middleware that works with streaming endpoints
  • Returns error back to caller

Before: (Panics and restarts)

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x30 pc=0x6c8b64]

goroutine 23 [running]:
.
.
.
DEBUG msg=config loaded: ENDPOINT format: 
DEBUG msg=config loaded: PRESHARED format: 
DEBUG msg=config loaded: config.yaml format: yaml
�INFO ts=2024-07-17T18:48:28Z caller=log/helper.go:109 service.id=7cf025427aea service.name= service.version= trace.id= span.id= msg=creating spicedb connection
�INFO ts=2024-07-17T18:48:28Z caller=log/global.go:73 service.id=7cf025427aea service.name= service.version= trace.id= span.id= msg=[HTTP] server listening on: [::]:8000
�INFO ts=2024-07-17T18:48:28Z caller=log/global.go:73 service.id=7cf025427aea service.name= service.version= trace.id= span.id= msg=[gRPC] server listening on: [::]:9000

After: (Panic is handled)

ERROR ts=2024-07-17T18:39:51Z caller=log/helper.go:80 service.id=82f48d79bb05 service.name= service.version= trace.id= span.id= latency=0.001127973 reason=runtime error: invalid memory address or nil pointer dereference: resource_type:{} relation:"bob" subject:{subject:{}}
goroutine 41 [running]:
.
.
.

Ex return:

ERROR:
  Code: Internal
  Message: unknown request error
  Details:
  1)	{
    	  "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    	  "reason": "UNKNOWN"
    	}

Ticket reference (if applicable)

Fixes # RHCLOUD-33931

Checklist

  • Are the agreed upon acceptance criteria fulfilled?

  • Was the 4-eye-principle applied? (async PR review, pairing, ensembling)

  • Do your changes have passing automated tests and sufficient observability?

  • Are the work steps you introduced repeatable by others, either through automation or documentation?

    • If automation is possible but not done due to other constraints, a ticket to the tech debt sprint is added
    • An SOP (Standard Operating Procedure) was created
  • The Changes were automatically built, tested, and - if needed, behind a feature flag - deployed to our production environment. (Please check this when the new deployment is done and you could verify it.)

  • Are the agreed upon coding/architectural practices applied?

  • Are security needs fullfilled? (e.g. no internal URL)

  • Is the corresponding Ticket in the right state? (should be on "review" now, put to done when this change made it to production)

  • For changes to the public API / code dependencies: Was the whole team (or a sufficient amount of ppl) able to review?

@lennysgarage lennysgarage changed the title add streaming for kratos recovery middleware add streaming support for kratos recovery middleware Jul 17, 2024
Signed-off-by: Jonathan Marcantonio <[email protected]>
@lennysgarage lennysgarage marked this pull request as ready for review July 18, 2024 13:45
@wscalf
Copy link
Contributor

wscalf commented Jul 18, 2024

/lgtm

@lennysgarage lennysgarage merged commit faa3704 into main Jul 18, 2024
7 checks passed
@lennysgarage lennysgarage deleted the streaming-recovery branch July 18, 2024 16:14
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.

2 participants