question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ack does not work

See original GitHub issue

Hey there,

We are currently working on a streaming python client that reads from NATS streaming, does some processing and then publishes the result into another subject in NATS streaming. See the code below:

    # ---8< code was cut here >8---

    async def cb(msg):
        nonlocal sc
        
        # when I ack the message directly the code works fine
        # await sc.ack(msg)

        # doing some processing here to create pubmsg
        pubmsg = ...

        await sc.publish('processed', pubmsg)
        # this ack does not keep NATS streaming from resending the message after 30s
        await sc.ack(msg)

    await sc.subscribe('notprocessed', start_at='first', cb=cb, manual_acks=True, ack_wait=30)

    # ---8< code was cut here >8---

The processing takes way shorter than the 30 seconds timeout for re-sends. Pulling the ack up in the code makes this sample work like expected.

Any ideas of what we do wrong?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
juandiegopalominocommented, Apr 5, 2019

@wallyqs awesome, it looks like we where right-- we dropped the max inflight from the default down to 10 and we haven’t gotten the issue since. Funnily enough we also did an update yesterday to log msg.sub._msgs_queue.qsize() directly (but using a property is more correct). Thank you for all your help!

1reaction
wallyqscommented, Apr 5, 2019

@juandiegopalomino yes I think that is what might be happening, the client could be buffering several redeliveries. First will add the following to be able to confirm the status of the client buffer: https://github.com/nats-io/asyncio-nats-streaming/compare/pending-queue-size Also need to consider whether need to add some logic to the client to ignore buffered messages that have already been acked…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ack doesn't do anything as a helper :: My Time At Portia ...
I am having this problem with Ack as well. I have him as a buddy, have fixed him, put flowers on grave, and...
Read more >
Python subprocess: Ack does not work - Stack Overflow
I am trying to execute f = open("test.txt", "w") check_call('ack "foo" /path/to/Documents/filename.txt', shell=True, stdout=f).
Read more >
Ack command does not work on Windows 10 for Neovim #60
On Linux, it works as expected. But on Windows, the command Ack simply does not work. Version info Neovim: version 0.3.4 Windows: Windows...
Read more >
manual Ack does not work after first message anymore
i have setup a "consumer" for a rabbitmq queue. Every delivery is put in a channel which is picked up by a goroutine...
Read more >
Ack/Ag does not return search result without
Then an excellent thing to do would be to look at the manual (either man ack or ack --man ) and search for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found