[Bug] RemotingHelper.connect swaps the socket send and receive buffer configuration
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- networking
Línea de trabajo
Lee RemotingHelper.connect(SocketAddress, int) y compara su configuración de búferes con la de NettyRemotingClient y NettyRemotingServer. Revisa las pruebas existentes para RemotingHelper y añade cobertura con configuraciones distintas para los búferes de envío y recepción; el trabajo estará terminado cuando cada configuración corresponda a su opción de socket.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Before Creating the Bug Report
- I searched the GitHub issues and found no similar bug report.
Runtime platform environment
All platforms.
RocketMQ version
develop branch (current), present in released versions as well.
Describe the Bug
RemotingHelper.connect(SocketAddress, int) applies the configured socket buffer sizes to the wrong socket options. The send-buffer knob (NettySystemConfig.socketSndbufSize) is used to set the receive buffer, and the receive-buffer knob (NettySystemConfig.socketRcvbufSize) is used to set the send buffer:
if (NettySystemConfig.socketSndbufSize > 0) {
sc.socket().setReceiveBufferSize(NettySystemConfig.socketSndbufSize);
}
if (NettySystemConfig.socketRcvbufSize > 0) {
sc.socket().setSendBufferSize(NettySystemConfig.socketRcvbufSize);
}
Everywhere else in the remoting module the mapping is the opposite one, e.g. in NettyRemotingClient and NettyRemotingServer:
socketSndbufSize->SO_SNDBUF(send buffer)socketRcvbufSize->SO_RCVBUF(receive buffer)
So in connect() the two are swapped.
This method is used by the store HA replication clients (DefaultHAClient and AutoSwitchHAClient). When an operator tunes com.rocketmq.remoting.socket.sndbuf.size / com.rocketmq.remoting.socket.rcvbuf.size, the HA sockets end up with the send and receive buffer sizes exchanged, which works against the intended replication tuning (the receive-heavy slave side and send-heavy master side get the opposite buffer they were configured for).
Expected Behavior
connect() should set SO_SNDBUF from socketSndbufSize and SO_RCVBUF from socketRcvbufSize, consistent with the rest of the remoting code.
Steps to Reproduce
Configure distinct values for the two knobs and open a connection through RemotingHelper.connect, then read back Socket#getSendBufferSize() / Socket#getReceiveBufferSize(): the reported send buffer tracks the receive-buffer configuration and vice versa.
How To Reproduce (code)
Open two connections that differ only in socketSndbufSize; the connection configured with the smaller send buffer ends up with the larger send buffer, because the value is taken from socketRcvbufSize.
- Lenguaje dominante
- Java
- Estrellas
- 22.7k
- Forks
- 12k
- Merge medio
- 3 d 18 h
- PR fusionados (30 d)
- 17
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de apache/rocketmq
-
CompressionType.of fails under the Turkish localePosiblemente ocupada @sharanggupta la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
[rocketmq-client-python] TransactionMQProducer allocates an unused producer during initializationAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
[Bug] notifyMasterOnline aborts the long-polling wake-up with a NullPointerException when an arrival drains a bucket firstPosiblemente ocupada @iloveeyjafjalla la tomó hace 29 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
apache/rocketmq#11441 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Enhancement] FilterFactory duplicate-registration and unregister semantics lack testsPosiblemente ocupada @chennaji9 la tomó hace 34 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
apache/rocketmq#11340 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
[Enhancement] LogicExpression three-valued truth table and short-circuit behavior lack direct testsPosiblemente ocupada @chennaji9 la tomó hace 34 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/rocketmq#11339 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/rocketmq
Issues similares
-
area/ai area/backend component/zeebe kind/task
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
spAnser/reacharound#38 ·
-
status: Ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
MobilityData/gtfs-validator#2254 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 89/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
jenkinsci/mcp-server-plugin#305 ·
Los mantenedores suelen responder en 1 día