Exceção ao tentar deletar uma instância com o handleQRCodes em andamento

Open
#222 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 9 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
go, rabbitmq
Domain
backend

Research direction

The panic is in pkg/whatsmeow/service/whatsmeow.go at teardownQR (line 852) called from handleQRCodes (line 742). Read those functions to understand the channel lifecycle and the race with instance deletion. Add synchronization so send on closed channel cannot happen. Done means deletion during QR generation stops cleanly without panic.

Written by the indexing model from the issue text.

Description

bug
Welcome!
  • Yes, I have searched for similar issues on GitHub and found none.
What did you do?

Através de captura de eventos via rabbitMQ, quando eu capturo o evento "QRTimeout" através de um consumer pelo RabbitMQ e, no mesmo momento o consumer tentou deletar a instância para interromper a geração do QRCode e parar de consumir recursos da máquina

What did you expect?

A instância ser deletada e a geração de QRCode ser interrompida

What did you observe instead of what you expected?

O serviço do evolutionGO lança uma exceção e é interrompido completamente, precisando reiniciar o serviço do docker

Screenshots/Videos

No response

Which version are you using?

0.7.2

What is your environment?

Docker

If applicable, paste the log output

whatsapp-1 | panic: send on closed channel
whatsapp-1 |
whatsapp-1 | goroutine 525 [running]:
whatsapp-1 | github.com/evolution-foundation/evolution-go/pkg/whatsmeow/service.(*MyClient).teardownQR(0xc0018a8480, {0xc000a04330, 0x21}, 0x1)
whatsapp-1 | /build/pkg/whatsmeow/service/whatsmeow.go:852 +0x953
whatsapp-1 | github.com/evolution-foundation/evolution-go/pkg/whatsmeow/service.(*MyClient).handleQRCodes.func1()
whatsapp-1 | /build/pkg/whatsmeow/service/whatsmeow.go:742 +0xec5
whatsapp-1 | created by github.com/evolution-foundation/evolution-go/pkg/whatsmeow/service.(*MyClient).handleQRCodes in goroutine 523
whatsapp-1 | /build/pkg/whatsmeow/service/whatsmeow.go:704 +0x86

Additional Notes

No response

Dominant language
Go
Stars
1k
Forks
610
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from evolution-foundation/evolution-go

All issues in evolution-foundation/evolution-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.