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
517 stars 228 forks source link

fix: don't crash if an already-drained/removed queue gets flushed again #1747

Closed feywind closed 1 year ago

feywind commented 1 year ago

This just allows correct clean-up behaviour if OrderedQueue.publish() gets called more than once. This shouldn't usually happen, but it seems like the easiest fix for the race condition mentioned in the issue.

Fixes: https://github.com/googleapis/nodejs-pubsub/issues/1746