weixin_39712821
weixin_39712821
2020-12-04 17:29

pubsub message is ack-ed for pubsub.topic.onPublish when function completes with error

Related issues

[REQUIRED] Version info

node:

local: v12.4.0 Deployed with


  "engines": {
    "node": "8"
  },

firebase-functions: "firebase-functions": "^3.6.0",

firebase-tools:

8.0.2

firebase-admin: "firebase-admin": "^8.10.0",

[REQUIRED] Test case

[REQUIRED] Steps to reproduce

I have functions.pubsub.topic('foo').onPublish function exported. When it returns rejected promise - there is no retries with same message => message was acknowledged despite failed function.

[REQUIRED] Expected behavior

I was googling around (SA, github issues) and I'm seeing different information. Some of them states that message is always acknowledged regardless function result, other states that it's acknowledged only after successful execution.

[REQUIRED] Actual behavior

Log from firebase functions console shows error for pubsub function:


5:51:46.877 PM play-realtimeNotifications
Function execution took 832 ms, finished with status: 'error'
5:51:46.864 PM play-realtimeNotifications
OtherError: <redacted_long_html>
    at Function.convertPlayAPIErrorToLibraryError (/srv/src/services/play-billing/PurchaseManager.ts:562:30)
    at playDeveloperApiClient.purchases.subscriptions.get.then.catch.err (/srv/src/services/play-billing/PurchaseManager.ts:439:55)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:229:7)
</anonymous></redacted_long_html>

So it's execution failed, but no retries performed. I'd expect that message should be not-acked, and re-delivered once again. I have checked Logs Viewer, filtering by function name around time of execution - there is only single execution and no retries for same message (I do log message for each one)

pubsub-no-retries

Were you able to successfully deploy your functions?

not related

该提问来源于开源项目:firebase/firebase-functions

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • weixin_39897758 weixin_39897758 5月前

    I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

    点赞 评论 复制链接分享
  • weixin_39525617 weixin_39525617 5月前

    Hi You can enable function retries using the Cloud Console: https://cloud.google.com/functions/docs/bestpractices/retries#using_the

    点赞 评论 复制链接分享
  • weixin_39712821 weixin_39712821 5月前

    So does it mean, that the subject of issue is correct, and any execution (success/failed) will acknowledge pubsub message?

    I think that it works differently from cloud functions. And honestly speaking it looks like api design fail.

    点赞 评论 复制链接分享

相关推荐