[Bug] BatchConsumerPolicy violation
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 30/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Domínio
- stream-processing
Direção de pesquisa
The report concerns batch receive on a partitioned Pulsar topic, where a batch policy with max_num_message=400 and timeout=-1 hangs while timeout=50ms does not. Start by reproducing the stall with a partitioned topic and a batch receive loop, then trace how the batch policy's count and timeout conditions are evaluated in the C++ client. Done means batch_receive returns after 400 messages and no longer blocks indefinitely when the timeout is disabled.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Search before asking
- I searched in the issues and found nothing similar.
Version
OS: Debian GNU/Linux
version 11 (Bullseye)
pulsar version 3.0.13
Minimal reproduce step
Use pulsar-client python library 3.1.0
initialise a BatchConsumerPolicy on n different partitions of the same topic with timeout = -1 , max_num_bytes = -1, max_num_message = 400
and then subscribe to partitions with this policy and begin consuming using batch_receive() method
What did you expect to see?
Expected that the consumption of messages from any partition will happen normally (wait for the max num and then return)
What did you see instead?
It was observed that the batch_receive() method got permanently stuck after a few days. Restarting the python program mitigated the issue. Another python program running a different subscription on the same topic with BatchConsumerPolicy(max_num_message=-1,max_num_bytes=-1,timeout=1second) ran perfectly without any issues and the topic was such that there would be 0 produce at most a few minutes in a couple of days. Whenever the first process got stuck, the second one never got stuck. The first one got stuck at seemingly irregular patterns but definitely eventually.
Another point to note is that this was the only difference between both of them.
Following this observation I changed the BatchConsumerPolicy from BatchConsumerPolicy(max_num_message=400,max_num_bytes=-1,timeout=-1) to BatchConsumerPolicy(max_num_message=-1,max_num_bytes=-1,timeout=50ms) and then that process never got stuck (3 months in now)
Anything else?
I suspect that max_num_messages and max_num_bytes are treated at the same priority as per
https://pulsar.apache.org/api/python/3.0.x/pulsar.ConsumerBatchReceivePolicy.html
but timeout is at a lower priority which might cause some deadlock
Are you willing to submit a PR?
- I'm willing to submit a PR!
- Linguagem predominante
- C++
- Estrelas
- 72
- Forks
- 93
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de apache/pulsar-client-cpp
-
Dificuldade 3/5 Meio dia Facilidade para iniciantes 62/100
apache/pulsar-client-cpp#623 ·
-
[Bug] MessageTest fails to build with GCC 15.3.0 and 16.2.1 (-Werror=stringop-truncation)Talvez já em andamento @davlgd assumiu há 3 dias. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 25/100
apache/pulsar-client-cpp#621 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 55/100
apache/pulsar-client-cpp#620 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
apache/pulsar-client-cpp#619 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 20/100
apache/pulsar-client-cpp#618 ·
Todas as issues de apache/pulsar-client-cpp
Issues semelhantes
-
documentation
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
EchoTools/nevr-runtime#2042 ·
Mantenedores costumam responder em até 1 dia
-
Download size and speed show scientific notation between 1000 and 1023 unitsTalvez já em andamento @RaphaelFakhri assumiu hoje. Aberta
Dificuldade 2/5 Menos de uma hora Facilidade para iniciantes 88/100
kiwix/kiwix-desktop#1570 ·
Mantenedores costumam responder em até 1 dia
-
Device Request
Dificuldade 2/5 Meio dia Facilidade para iniciantes 62/100
dresden-elektronik/deconz-rest-plugin#8686 ·
Mantenedores costumam responder em até 1 dia
-
nixos/noctalia-greeter: greeter finds no sessions (session dirs not passed via XDG_DATA_DIRS)Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
aminya/project_options#303 ·