-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Messages are retrieved before modifyAckDeadline time expires #413
Comments
@TraxRetail does the rest of your |
Yes, Our removeMessage (acknowledge) and extendMessageLock(modifyAckDeadline) use I followed your documentation: ***Additional data: |
You might consider adjusting the const subscription = pubSub.subscription(queue, {maxConnections: 1}); |
Tried it now, it's still inconsistent, it gets retrieved before the lock expires. |
So by default the handwritten client attempts to lock messages based on the 99th percentile of acknowledge times. It is very likely that your If you want to manage the lock yourself, I would suggest using the Alternatively we have a PR (#388) that aims to give a finer level of control for locking messages if you'd like to give that a test run. |
The pr #388 doesn't run. 'Cannot read property '_readableState' of undefined'. After trying many things, When getting a message using a a topic in the subscription helps:
After finding the topic that it listens to it works better for smaller (20,30,80,200) most of the times it succeeds, but for bigger numbers like 300+ it might cut it in half. |
Are we supposed to use just v1 subscriber client OR subscriber but not both?
|
@TraxRetail I think in most cases the handwritten client should fit most needs, however if you wanted to manage locks yourself then you definitely want to use |
So after transforming receive message to use v1 subscriber client (with pull method) it works perfectly. *** When using subscription.on('message', messageHandler) and receiving messages, |
Not with the hand written client, no. We lock all messages until they are either ack'd or nack'd. Its possible that they will be redelivered if the backend sends the messages again or if we encounter some unexpected latency. |
So I'm not sure it's a bug, You can't use subscription.on by opening and closing the connection (and reading messages) |
I agree, we could do a better job of documenting it and I believe there are efforts underway to revamp our documentation, so I'll ask that you bare with us in the mean time. I'm going to close this out, but please feel free to re-open if something else comes up! |
@callmehiphop -- what would be the appropriate change in the docs here? Perhaps we could contribute a PR. I know you've got a lot going on. |
1) please explain the difference between v1 code and the rest, that one is
just calling api and the other one is manual control over connections,
optimizations and cet...
2)if you want to use extend message lock (modify ack deadline) dont use the
manual subscription.on because it does it by itself and the users will
experience race conditions.
those are the most important for me.
…On Mon, 7 Jan 2019, 18:12 Kir Titievsky ***@***.*** wrote:
@callmehiphop <https://github.com/callmehiphop> -- what would be the
appropriate change in the docs here? Perhaps we could contribute a PR. I
know you've got a lot going on.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#413 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMgcEBbO4p43RC542C3SPZcjrmqWY6VMks5vA2PpgaJpZM4ZVEDC>
.
|
So we actually do make mention of the message lock functionality in the Subscription overview, however it might be worth an additional mention in the README. As far as docs explaining the differences between Subscription and v1.SubscriberClient.. that sounds like it could be tricky since all the documentation for it is auto-generated. @JustinBeckwith will any of the upcoming doc changes help explain the differences between the two? |
message lock functionality is mentioned, but it doesnt work using
subscription.on functionality
…On Mon, 7 Jan 2019, 18:26 Dave Gramlich ***@***.*** wrote:
So we actually do make mention of the message lock functionality in the Subscription
overview
<https://cloud.google.com/nodejs/docs/reference/pubsub/0.22.x/Subscription>,
however it might be worth an additional mention in the README.
As far as docs explaining the differences between Subscription and
v1.SubscriberClient.. that sounds like it could be tricky since all the
documentation for it is auto-generated. @JustinBeckwith
<https://github.com/JustinBeckwith> will any of the upcoming doc changes
help explain the differences between the two?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#413 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AMgcEFR5k7A8f_5O9xugjmDpvu-qTHjeks5vA2cUgaJpZM4ZVEDC>
.
|
modifyAckDeadline doesn't work as expected.
We are able to retrieve messages before the lock is expired:
@google-cloud/pubsub 0.22.2 (reproducible in lower versions)
nodejs 8.12.0
npm 6.5.0
linux mint 17.3
The queue default AckDeadline is 30 seconds in our code and in the cloud.
Our mocha test:
0 - send a message
0 - pulldown 1 message from subscription with 30 second deadline and it's received.
0 (later) - modifyAckDeadline by 30 seconds
25 sec - pulldown 1 message, it is retrieved though it should be locked.
It happens with smaller numbers as well.
extendMessageLock function
The text was updated successfully, but these errors were encountered: