[Bug] maxUserPropertySize = 0 (documented as "no limit") rejects every message with a tag, key or user property

Abierto
#11,387 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@iloveeyjafjalla ya está trabajando en esto.

Desde el 13/10/2026.

  • #11388 de @iloveeyjafjalla — abierto

Evaluación

Dificultad
1/5
Tiempo estimado
Menos de una hora
Aptitud para principiantes
20/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
grpc, java
Área
backend

Línea de trabajo

The user-property check is in SendMessageActivity in the proxy module, and the limit comes from ProxyConfig.maxUserPropertySize. Compare it with the guards above it for message body and group size, which return early when the limit is not positive. Done means a non-positive limit skips the check, and a test covers a tagged message with the limit set to 0. Pull request #11388 already addresses this, so check it before starting.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Before Creating the Bug Report
  • I found a bug, not just asking a question, which should be created in GitHub Discussions.
  • I have searched the GitHub Issues and GitHub Discussions of this repository and believe that this is not a duplicate.
  • I have confirmed that this bug belongs to the current repository, not other repositories of RocketMQ.
Runtime platform environment

OS: any (proxy module, gRPC v2 producer path)

RocketMQ version

branch: develop
Git commit id: 9ea2ccdc2b41445aee5e177e14e501d606f5a1ed (the files are unchanged on develop@b76420599)

JDK Version

Compiler: Temurin 1.8.0_504 (target 1.8, same as CI)

Describe the Bug

Setting maxUserPropertySize to the documented "no limit" value rejects every message that carries a tag, a key or a user property.

ProxyConfig documents the option as:

/**
 * max user property size, 0 or negative number means no limit for proxy
 */
private int maxUserPropertySize = 16 * 1024;

and the other size limits in SendMessageActivity all honour that convention:

int max = ConfigurationManager.getProxyConfig().getMaxMessageSize();
if (max <= 0) { return; }                      // message body
int maxSize = ...getMaxMessageGroupSize(); if (maxSize <= 0) { return; }     // message group
long maxDelay = ...getMaxDelayTimeMills();  if (maxDelay <= 0) { return; }   // delay time
long maxTransactionRecoverySecond = ...;    if (maxTransactionRecoverySecond <= 0) { return; }

but the user-property check has no such guard:

if (userPropertySize > config.getMaxUserPropertySize()) {
    throw new GrpcProxyException(Code.MESSAGE_PROPERTIES_TOO_LARGE, "the total size of user property is too large, max is " + ...);
}

userPropertySize counts the user properties, the tag and the keys, so it is greater than 0 for any message that uses them —
and with maxUserPropertySize = 0 (or negative, i.e. the documented "no limit") every such send fails with
MESSAGE_PROPERTIES_TOO_LARGE. The documented way of disabling the limit therefore bricks those sends instead of lifting
the check.

Steps to Reproduce
  1. Set maxUserPropertySize: 0 in rmq-proxy.json (documented meaning: no limit).
  2. Send a message with a tag or a user property through a gRPC client.
  3. The broker answers MESSAGE_PROPERTIES_TOO_LARGE ("the total size of user property is too large, max is 0").
Expected behavior

A non-positive maxUserPropertySize disables the check, exactly like the other size limits of the same activity.

Actual behavior

Every message that carries a tag, a key or a user property is rejected.

Additional context

Fix: run the comparison only when the configured limit is positive.

Lenguaje dominante
Java
Estrellas
22.7k
Forks
12k
Merge medio
4 d 20 h
PR fusionados (30 d)
11

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de apache/rocketmq

Todos los issues de apache/rocketmq

Issues similares

Más issues de Java

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.