Skip to content
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

Packet Identifiers are exhausted #13

Open
falknerdominik opened this issue Aug 30, 2018 · 1 comment
Open

Packet Identifiers are exhausted #13

falknerdominik opened this issue Aug 30, 2018 · 1 comment

Comments

@falknerdominik
Copy link

falknerdominik commented Aug 30, 2018

Hi,

I am using this package for the development of a publisher service. The service just takes a CSV data file and reads it line by line. It then sends a message via mqtt for each line. This works nicely but after some time logrus shows this error message in the log:

ERRO[4733] Error publishing message                      error="Packet Identifiers are exhausted"

What happened here? How can I prevent this? Is the message lost or will the client auto retry sending it?

EDIT: Restarting the service solves the problem, it then works again for some time but after a few minutes it shows the error again.

@joonas-fi
Copy link

The error message is defined in

ErrPacketIDExhaused = errors.New("Packet Identifiers are exhausted")

And raised only here:

return 0, ErrPacketIDExhaused

Limits are defined here:

minPacketID uint16 = 1

So basically it seems that you're hitting the limit of 65535 in-flight packets, since the sendingPackets map is cleaned up after the PUBLISH operation gets an ACK.

Are you sure you are not publishing messages much faster than the MQTT server can handle them? (slow connection to MQTT server, or MQTT server has slow CPU or something). Or is there a bug in the MQTT server where the packets simply don't get ACKed at all? 65535 is quite a generous amount of in-light PUBLISHes to have, so there must be something horribly wrong that you are either doing, or hitting a bug somewhere.

Are you publishing concurrently from many threads?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants