Repository navigation
pubsub will throw during Subscription.pull when autoAck is on and no messages avail #455
Copy link
Copy link
Closed
Labels
🚨This issue needs some love.This issue needs some love.api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Milestone
Description
Activity
To clarify, is this still a bug in master?
I realize we do need to release 0.13.0 soon. We've been wrestling with some regression tests for a while that have distracted from a next release. I hope to have something out soon.
Yes, the behavior described (throw+exit) happens on gcloud-node master as of today, and the code snippets in comment 1 are from master. Thanks!
Yep totally makes sense, I'll get a fix out for this.
Fix, as you suggested, in #456.
- addedtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.
on May 14, 2015 - added🚨This issue needs some love.This issue needs some love.triage meI really want to be triaged.I really want to be triaged.
on Apr 6, 2020 - added a commit that references this issue
on Aug 22, 2022 - added a commit that references this issue
on Sep 15, 2022 28 remaining items
- added a commit that references this issue
on Feb 23, 2026 - added 2 commits that reference this issue
on Feb 24, 2026 - added a commit that references this issue
on Mar 18, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
Metadata
Metadata
Assignees
Labels
🚨This issue needs some love.This issue needs some love.api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.triage meI really want to be triaged.I really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
I'm porting to v1beta2 of the pubsub service. In recent versions of gcloud-node, my previous code will abort in Subscription.pull with:
I use autoAck and right now there are very few messages on the topic. So I think what's happening is the long-poll completes without receiving a message, and this block in Subscription.pull:
calls self.ack with ackIds empty because receivedMessages is empty. I fixed this in my local copy with:
since there's no point in trying to ack if there are no messages. If I had a bit more time right now, I'd offer a PR with a test, but let's get an issue opened at least to see if the problem has been characterized correctly first.