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

Wait for functions to become ready #6125

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

negz
Copy link
Member

@negz negz commented Nov 19, 2024

Description of your changes

When a function is newly deployed or updated folks will see a few connection refused errors in their XR. This setting may help with that by telling Crossplane to wait for the function to become ready rather than immediately returning an error.

This commit also removes the 10 second timeouts for dialing and running a function. gRPC no longer recommends using DialContext. Instead they recommend using NewClient, which doesn't actually create a connection and thus doesn't need a timeout.

Instead of a 10 second timeout to run the function, RunFunction now just uses the parent context's timeout which happens to be 2 minutes. This means the entire function pipeline (technically the entire XR reconcile) must complete within 2 minutes. This allows some functions to take a bit longer as long as the total runtime is within the timeout.

I have:

  • Read and followed Crossplane's contribution process.
  • Run earthly +reviewable to ensure this PR is ready for review.
  • Added or updated unit tests.
  • Added or updated e2e tests.
  • Linked a PR or a docs tracking issue to document this change.
  • Added backport release-x.y labels to auto-backport this PR.

Need help with this checklist? See the cheat sheet.

When a function is newly deployed or updated folks will see a few
connection refused errors in their XR. This setting may help with that
by telling Crossplane to wait for the function to become ready rather
than immediately returning an error.

This commit also removes the 10 second timeouts for dialing and running
a function. gRPC no longer recommends using DialContext. Instead they
recommend using NewClient, which doesn't actually create a connection
and thus doesn't need a timeout.

Instead of a 10 second timeout to run the function, RunFunction now just
uses the parent context's timeout which happens to be 2 minutes. This
means the entire function pipeline (technically the entire XR reconcile)
must complete within 2 minutes. This allows some functions to take a bit
longer as long as the total runtime is within the timeout.

Signed-off-by: Nic Cope <nicc@rk0n.org>
Copy link
Member

@jbw976 jbw976 left a comment

Choose a reason for hiding this comment

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

This looks like a reasonable approach to me, and it's nice that we've upgraded our usage of DialContext now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants