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
516 stars 227 forks source link

feat: Attempted implemented graceful shutdown #1855

Open jjm340 opened 8 months ago

jjm340 commented 8 months ago

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

Fixes # 🦕

Note: If you are opening a pull request against a legacy branch, PLEASE BE AWARE that we generally won't accept these except for things like important security fixes, and only for a limited time.

google-cla[bot] commented 8 months ago

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

feywind commented 7 months ago

@jjm340 Thanks for opening a PR. I think I can see some ways we can simplify this, but my main concern is that it might be considered a breaking change. I'd say "let me talk to the team on Thursday" except it's going to be US Thanksgiving :) so many of them will be out. Anyhow, I'll get back to you.

jjm340 commented 7 months ago

@jjm340 Thanks for opening a PR. I think I can see some ways we can simplify this, but my main concern is that it might be considered a breaking change. I'd say "let me talk to the team on Thursday" except it's going to be US Thanksgiving :) so many of them will be out. Anyhow, I'll get back to you.

@feywind Thanks!! I had the same thought about this being a breaking change and a colleague and I discussed putting this behind an option flag, but wanted feedback from Google on that. I believe one side effect is that if this approach is used and a message is neither ACKed or NACKed, then the promise would never resolve and keep the consumer open indefinitely.