Open tigercl opened 2 months ago
It's not hard to fix, but after reading the code, it looks like this was designed like this deliberately.
There are two possibilities how to fix it:
What is the best solution @tigercl ?
@ieQu1 I think the latter is better, but this mechanism should already exist, it's just that the message queue will reach the maximum limit later than the user expects.
I'm just worried that if the actual effective value is much larger than the value set by the user, it may cause OOM.
What happened?
The corresponding code in EMQX is as follows:
PLen
is the length of a priority queue. The following code usesPLen
andMaxLen
to compare, which may cause the actual message queue length to exceed the maximum queue length I set.For example, if I set priorities for 10 topics and set the maximum message queue length to 1000, the actual maximum message queue length will be 10 * 1000 = 10000.
Below is my test result, showing that the current queue length 2 has exceeded the maximum queue length 1:
And here is http response returned by EMQX:
What did you expect to happen?
The total length of all priority queues should not exceed the maximum queue length.
How can we reproduce it (as minimally and precisely as possible)?
No response
Anything else we need to know?
No response
EMQX version
EMQX 5.7.1
OS version
Log files