-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pubsub/pstest): fix panic on undelivered message (#7377)
* refactor(pubsub/pstest): replace global now atomic with struct field It is counterintuitive to plumb through a time.Now replacement function only to have it refer to a global variable. Instead, make the Server timeNowFunc an atomic.Value field and add a now method accessor that loads the function value atomically and invokes it. Use that in tests, and also in the exported SetTimeNowFunc variable. * fix(pubsub/pstest): prevent panic on undelievered messages If a running pstest Server has a subscription without a dead letter topic configured, and there's a pending message in the subscription that is not received after the retention duration (10 minutes), the deliver loop for the subscription will trigger a panic. This commit prevents the panic by not trying to deliver expired messages to the dead letter topic, since that's what the live service does either. --------- Co-authored-by: Alex Hong <[email protected]>
- Loading branch information
Showing
2 changed files
with
60 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters