We have a GCP pub sub subscription with the Expiration set to 1 day, while the Message Retention Duration is also set to 1 day. There were no messages in the subscription but it still did not expire even after 2 days, also, no subscribers were connected to the subscription.
the documentation states below https://cloud.google.com/pubsub/docs/subscription-properties#expiration_period
If you specify the expiration period, the value must be longer than the message retention duration specified in the Message retention duration option.
Could this be causing the Subscription to not expire?
Having the retention duration and the expiration period equal should not prevent the expiration of subscriptions that have no activity. If the subscription did not expire and it is a pull subscription, then the subscription should expire if there are no issued pull/streaming pull requests, updates to the subscription, or seek requests.
You could look at the metrics for pull_request_count, open_streaming_pulls, config_updates_count, and seek_request_count to ensure they are all zero for a one-day period. If any is non-zero, then you would want to determine what is making the request. If they are all zero, it would be best to open a support ticket where information about your subscription can be examined in the backend.
The documentation will be updated to clarify that these two values can be the same.