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: Stop policy eval when context is done #27

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

Hamsajj
Copy link
Contributor

@Hamsajj Hamsajj commented Mar 29, 2024

Ticket(s)

While working on Act timeout, I realized that the context used to control timeout for policy evaluation is not actually used in the eval function. Unless I was missing something, this PR should fix that and use the context to actually stop the policy evaluation when the context is canceled or timed out

Description

Related PRs

Development Checklist

  • I have added a descriptive title to this PR.
  • I have squashed related commits together.
  • I have rebased my branch on top of the latest main branch.
  • I have performed a self-review of my own code.
  • I have commented on my code, particularly in hard-to-understand areas.
  • I have added docstring(s) and type annotations to my code.
  • I have made corresponding changes to the documentation (docs).
  • I have added tests for my changes.

Legal Checklist

@mostafa mostafa self-requested a review April 1, 2024 20:03
Copy link
Member

@mostafa mostafa left a comment

Choose a reason for hiding this comment

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

Hey @Hamsajj,

Thanks for your contribution! I left a couple of comments. 🙏 Otherwise LGTM!

act/policy_test.go Outdated Show resolved Hide resolved
act/policy_test.go Show resolved Hide resolved
@Hamsajj Hamsajj force-pushed the fix-eval-timeout branch from 4d4ba5d to 6941cd7 Compare April 1, 2024 21:55
@Hamsajj Hamsajj requested a review from mostafa April 1, 2024 21:57
Copy link
Member

@mostafa mostafa left a comment

Choose a reason for hiding this comment

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

LGTM! I just left a question.

act/policy.go Outdated Show resolved Hide resolved
@Hamsajj Hamsajj force-pushed the fix-eval-timeout branch from 6941cd7 to c3942bc Compare April 4, 2024 12:52
@Hamsajj Hamsajj requested a review from mostafa April 4, 2024 12:54
@mostafa mostafa merged commit ef8ab8d into gatewayd-io:main Apr 4, 2024
1 check passed
@Hamsajj Hamsajj deleted the fix-eval-timeout branch April 5, 2024 12:47
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