googleapis / nodejs-pubsub

Node.js client for Google Cloud Pub/Sub: Ingest event streams from anywhere, at any scale, for simple, reliable, real-time stream analytics.
https://cloud.google.com/pubsub/
Apache License 2.0
521 stars 227 forks source link

Possible race condition between Topic.flush and OrderedQueue.publish #1746

Closed feywind closed 1 year ago

feywind commented 1 year ago

It's theoretically possible that calling topic.flush() would pull a reference to an ordered queue that would emit 'drain' (and thus be deleted) after the topic.flush() starts. This could result in calling queue.publish() and a reference error.