Repository navigation
Closed
Labels
api: pubsubIssues related to the Pub/Sub API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Please make sure you have searched for information in the following guides.
- Search the issues already opened: https://github.com/GoogleCloudPlatform/google-cloud-node/issues
- Search StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform+node.js
- Check our Troubleshooting guide: https://github.com/googleapis/google-cloud-node/blob/main/docs/troubleshooting.md
- Check our FAQ: https://github.com/googleapis/google-cloud-node/blob/main/docs/faq.md
- Check our libraries HOW-TO: https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md
- Check out our authentication guide: https://github.com/googleapis/google-auth-library-nodejs
- Check out handwritten samples for many of our APIs: https://github.com/GoogleCloudPlatform/nodejs-docs-samples
A screenshot that you have tested with "Try this API".
Video reproducing bug
Screen.Recording.2025-07-19.at.08.53.06.mov
Link to the code that reproduces this issue. A link to a public Github Repository or gist with a minimal reproduction.
A step-by-step description of how to reproduce the issue, based on the linked reproduction.
Start a subscriber, setting flowControl, with maxMessages and allowExcessMessages
const subscription = pubsub.subscription("subscription-name", {
flowControl: {
maxMessages: 2,
allowExcessMessages: false
}
});
console.log(`Listening for messages on subscription`);
subscription.on('message', async message => {
const n = Number(message.data)
console.log('Received message:', n);
if (n % 2 === 0) {
await message.ackWithResponse();
console.log('ack successfully');
} else {
await message.nackWithResponse();
console.log('nack successfully');
}
});When start send mensagens to topic, after two nacks (number equal of maxMessages) subscriber stop of receiving new messages
A clear and concise description of what the bug is, and what you expected to happen.
Subscriber should continue receiving messages
A clear and concise description WHY you expect this behavior, i.e., was it a recent change, there is documentation that points to this behavior, etc. **
Its a bug because subscriber will never receive any more messages
Reacted by nunoyuzoreis and LucasSegersFabro
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the Pub/Sub API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
Activity
feywind commentedon Jul 22, 2025
@Luisgustavom1 Thanks for the report and the PR! I probably can't look at this until next week but wanted to acknowledge receiving it.
Luisgustavom1 commentedon Aug 2, 2025
Ok, thanks for your attention!
It's a very strange bug that we have to active allowExcessMessage as workaround
Luisgustavom1 commentedon Aug 9, 2025
@feywind some update?
Gustavo-maia-gst commentedon Sep 17, 2025
@feywind any update? Same problem here
kvalv commentedon Nov 26, 2025
Just want to extend gratitude for creating this issue, @Luisgustavom1 😄 I encountered the same issue without understanding what might have caused it. Nice to see the same issue appear in the github issues, so at least I know it's a bug. 🙌
feywind commentedon Feb 24, 2026
I added a comment to the provided PR - I do think there's an oversight here with removing nack'd messages from the inventory, but things that are being modack'd legitimately shouldn't get removed. The code path in there is a little circuitous, but I think (without staring at it) that the leaser is going to end up calling back through Subscriber's modack method when extending deadlines.
This PR otherwise looks good to me. This package will be moving into our Node monorepo some time in the next month or two, so I'd like to get this closed (the issues will carry over, but not PRs).