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

feat: prevent proxy context cancelled #144

Merged
merged 4 commits into from
Aug 16, 2022

Conversation

krtkvrm
Copy link
Member

@krtkvrm krtkvrm commented Aug 3, 2022

Expectation

  • request cancellation or interruption from client side should not stop processing on shield side

}

func (c Context) Deadline() (time.Time, bool) {
return time.Time{}, false
Copy link
Member Author

Choose a reason for hiding this comment

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

doing

t, b := c.ctx.Deadline()
return t, b

was throwing stack overflow

@coveralls
Copy link

coveralls commented Aug 3, 2022

Pull Request Test Coverage Report for Build 2837820768

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 294 unchanged lines in 11 files lost coverage.
  • Overall coverage decreased (-0.1%) to 50.852%

Files with Coverage Reduction New Missed Lines %
internal/api/v1beta1/namespace.go 2 35.63%
internal/store/postgres/group_repository.go 4 76.56%
internal/api/v1beta1/v1beta1.go 8 0%
internal/api/v1beta1/action.go 10 36.96%
internal/api/v1beta1/policy.go 11 37.82%
internal/api/v1beta1/resource.go 12 0%
internal/api/v1beta1/project.go 33 31.82%
internal/api/v1beta1/org.go 36 27.57%
internal/api/v1beta1/group.go 49 0%
internal/api/v1beta1/user.go 64 39.91%
Totals Coverage Status
Change from base Build 2779265837: -0.1%
Covered Lines: 2329
Relevant Lines: 4580

💛 - Coveralls

return nil
}

func (c Context) Err() error {
Copy link
Member Author

Choose a reason for hiding this comment

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

We can also only prevent "Context Cancelled" errors, but let others to return

return time.Time{}, false
}

func (c Context) Done() <-chan struct{} {
Copy link
Member Author

Choose a reason for hiding this comment

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

we can also log when done != nil

@mabdh
Copy link
Member

mabdh commented Aug 5, 2022

@krtkvrm for the PR prefix, is it a feat: or a fix: ?

also, should we create a new issue and link the issue to this PR?

@krtkvrm krtkvrm changed the title prevent proxy context cancelled feat: prevent proxy context cancelled Aug 5, 2022
@krtkvrm krtkvrm requested a review from spy16 August 11, 2022 07:03
@rohilsurana rohilsurana merged commit 6d32ca1 into main Aug 16, 2022
@rohilsurana rohilsurana deleted the prevent-req-cancel-from-client branch August 16, 2022 05:41
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.

5 participants