Problem
Environment
- Cloud Pub/Sub
Solution
- Check if subscription expiration policy has been set (by default 31 days).
- Check if subscription has been inactive for the set duration.
- Check for logs with method InternalExpireInactiveSubscription using following log filter:
resource.type="pubsub_subscription" protoPayload.methodName="Subscriber.InternalExpireInactiveSubscription"
- Set expiration period to desired value. 31 days is the default expiration period. The minimum is 1 day.
- To prevent a subscription from expiring, set the expiration period to never.
Cause
By default, subscriptions expire after 31 days of inactivity (for instance, if there are no active connections, pull requests, or push successes). if subscription expiration policy has been set, subscriptions expire after a set duration of inactivity.
Using subscription expiration policies, you can configure the inactivity duration or make the subscription persistent regardless of activity by setting the expiration period to never. You can also delete a subscription manually.