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

Notify deadline exceeded error on subscription creation #180

Merged
merged 1 commit into from
Dec 7, 2023

Conversation

int128
Copy link
Member

@int128 int128 commented Nov 30, 2023

Problem to solve

Currently, we get the following warning events:

SubscriptionCreateError: Failed to create Subscription in Pub/Sub: CreateSubscription: rpc error: code = NotFound desc = Resource not found (resource=...)
Events emitted by the subscription-controller seen at 2023-11-30 03:31:04 +0000 UTC since 2023-11-30 03:31:04 +0000 UTC

If a subscription is creating before the topic, it fails but will succeed after retrying. It would be nice if we get only the deadline exceeded errors.

How to solve

Notify an error if the deadline is exceeded, i.e., Now - CreationTimestamp > Deadline.

@int128 int128 force-pushed the int128/notice-subscription-takes-long-time branch from 5716aef to 1baedd2 Compare November 30, 2023 06:30
@int128 int128 changed the title int128/notice subscription takes long time Notify deadline exceeded error on subscription creation Nov 30, 2023

This comment has been minimized.

@@ -23,15 +23,19 @@ import (
// SubscriptionSpec defines the desired state of Subscription
type SubscriptionSpec struct {
// subscription ID
//+kubebuilder:validation:XValidation:message="Immutable field",rule="self == oldSelf"
Copy link
Member Author

Choose a reason for hiding this comment

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

@int128 int128 force-pushed the int128/notice-subscription-takes-long-time branch from 6f7444c to eea831c Compare November 30, 2023 06:36
Copy link
Contributor

diff

  • config/default/apiextensions.k8s.io_v1_customresourcedefinition_subscriptions.googlecloudpubsuboperator.quipper.github.io.yaml
  • config/default/apiextensions.k8s.io_v1_customresourcedefinition_topics.googlecloudpubsuboperator.quipper.github.io.yaml

config/default/apiextensions.k8s.io_v1_customresourcedefinition_subscriptions.googlecloudpubsuboperator.quipper.github.io.yaml

--- a/tmp/kustomize-action-YPfXQV/config/default/apiextensions.k8s.io_v1_customresourcedefinition_subscriptions.googlecloudpubsuboperator.quipper.github.io.yaml
+++ b/tmp/kustomize-action-mRgcaV/config/default/apiextensions.k8s.io_v1_customresourcedefinition_subscriptions.googlecloudpubsuboperator.quipper.github.io.yaml
@@ -36,15 +36,27 @@ spec:
               subscriptionID:
                 description: subscription ID
                 type: string
+                x-kubernetes-validations:
+                - message: Immutable field
+                  rule: self == oldSelf
               subscriptionProjectID:
                 description: project ID of subscription
                 type: string
+                x-kubernetes-validations:
+                - message: Immutable field
+                  rule: self == oldSelf
               topicID:
                 description: topic ID
                 type: string
+                x-kubernetes-validations:
+                - message: Immutable field
+                  rule: self == oldSelf
               topicProjectID:
                 description: project ID of topic
                 type: string
+                x-kubernetes-validations:
+                - message: Immutable field
+                  rule: self == oldSelf
             type: object
           status:
             description: SubscriptionStatus defines the observed state of Subscription

config/default/apiextensions.k8s.io_v1_customresourcedefinition_topics.googlecloudpubsuboperator.quipper.github.io.yaml

--- a/tmp/kustomize-action-YPfXQV/config/default/apiextensions.k8s.io_v1_customresourcedefinition_topics.googlecloudpubsuboperator.quipper.github.io.yaml
+++ b/tmp/kustomize-action-mRgcaV/config/default/apiextensions.k8s.io_v1_customresourcedefinition_topics.googlecloudpubsuboperator.quipper.github.io.yaml
@@ -36,9 +36,15 @@ spec:
               projectID:
                 description: ID of project
                 type: string
+                x-kubernetes-validations:
+                - message: Immutable field
+                  rule: self == oldSelf
               topicID:
                 description: ID of topic
                 type: string
+                x-kubernetes-validations:
+                - message: Immutable field
+                  rule: self == oldSelf
             type: object
           status:
             description: TopicStatus defines the observed state of Topic

@int128 int128 marked this pull request as ready for review December 7, 2023 06:23
@int128 int128 requested a review from 44smkn December 7, 2023 06:23
Copy link
Member

@pankona pankona left a comment

Choose a reason for hiding this comment

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

LGTM!! 😋

@int128 int128 requested a review from pankona December 7, 2023 06:23
@pankona pankona merged commit 14e527a into main Dec 7, 2023
@pankona pankona deleted the int128/notice-subscription-takes-long-time branch December 7, 2023 06:24
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.

3 participants