Unhandled promise in message.ack() makes it hard for a terminating script to wait for ack #1221
Labels
api: pubsub
Issues related to the googleapis/nodejs-pubsub API.
type: feature request
‘Nice-to-have’ improvement, new feature or different behavior or design.
Environment details
@google-cloud/pubsub
version: 2.10.0Steps to reproduce
See the comment line starting with
// ISSUE:
in the code above. An unexpected message will in this case not be cleared from the subscription. If my process would restart automatically, it would be in an infinite loop now. The problem is thatm.ack()
does not return a promise (while the underlying subscriber ack function does). That seems to be a problem for others as well, see:I read in #428:
I cannot find that push back discussion. If there's a good reason not to return a promise, an alternative would be to make
_waitForFlush
a public method. That I canawait
that before exiting the process.ps. I can of course set an arbitrary timeout before exiting the process, but that's ugly.
The text was updated successfully, but these errors were encountered: