You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 17, 2026. It is now read-only.
Both methods Topic.flush and PubSub.close indicate that it is ok to call them with no parameter and await their completion. Unfortunately when passing no callback, the function internals don't properly await and instead have unhandled promises which can in certain cases lead to message not being sent correctly.
This could be a reason to the recently observed increase in Total timeout of API google.pubsub.v1.Publisher exceeded 60000 milliseconds before any response was received. errors on Google Cloud Functions and Cloud Run because those runtime instances assumingly switch to idle before all messages have been send.
// It doesn't matter here if callback is undefined; the Publisher
// flush() will handle it.
this.publisher.flush(callback!);
}
The call to this.publisher.flush(callback!); is not awaited nor returned so there is no way for the caller of Topic.flush to await the internal Promise completion without passing a callback.
Both methods
Topic.flushandPubSub.closeindicate that it is ok to call them with no parameter andawaittheir completion. Unfortunately when passing no callback, the function internals don't properlyawaitand instead have unhandled promises which can in certain cases lead to message not being sent correctly.This could be a reason to the recently observed increase in
Total timeout of API google.pubsub.v1.Publisher exceeded 60000 milliseconds before any response was received.errors on Google Cloud Functions and Cloud Run because those runtime instances assumingly switch to idle before all messages have been send.Take a look at
Topic.flush:nodejs-pubsub/src/topic.ts
Lines 193 to 199 in 38fba8b
The call to
this.publisher.flush(callback!);is not awaited nor returned so there is no way for the caller ofTopic.flushtoawaitthe internal Promise completion without passing acallback.Similar issue exists in
PubSub.close.