VR command aggregation drops commands and fails with NPE when two jobs aggregate on the same router
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- java
- Área
- cloud, infrastructure
Línea de trabajo
Start with core/.../agent/resource/virtualnetwork/VirtualRoutingResource.java and trace how AggregationControlCommand Start and Finish access the per-router queue, _vrLockMap, and aggregation map. Check the agent request threading and related tests before changing these shared maps. Done means concurrent aggregation for one router does not replace or misapply queued commands, create inconsistent locks, or fail when Finish finds no queue; add coverage for those cases.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
problem
Command aggregation on a virtual router isn't safe when two jobs aggregate commands for the same router at the same time. Parallel tier deploys in one VPC do this. Commands get dropped, and jobs fail with a NullPointerException.
VirtualRoutingResource (core/.../agent/resource/virtualnetwork/VirtualRoutingResource.java) keeps one aggregation queue per router name in a HashMap:
AggregationControlCommandStart puts a new queue for the router. A second Start while one exists replaces it, so the commands the first job has queued so far are never applied. Their answers were already successful, because a queued command is answered with success at once.- Every other
NetworkElementCommandfor that router goes into whichever queue is current. - Finish applies the current queue and removes it. The first job's Finish applies the second job's queue, and the second job's Finish then finds no queue. The loop and then
queue.clear()in thefinallyblock throwjava.lang.NullPointerException: Cannot invoke "java.util.Queue.clear()" because "queue" is null.
The result is that one job fails, and another reports success although some of its configuration never reached the router.
The per-router lock map (_vrLockMap) and the aggregation map are also plain HashMaps changed from parallel agent request threads. The lock is created with a check-then-put, so two threads can get different locks for the same router.
This may be one cause of #11710: with redundant routers, the two routers of a VPC can end up with different configurations.
versions
4.22 (the code is the same on main and 4.20).
The steps to reproduce the bug
- Create a VPC with redundant routers on KVM.
- Create several tiers and deploy VMs into them in parallel, for example 24 deploys across the tiers at once.
- Some deploys fail. The management server logs
Failed to re-program the network as a part of network ... implement due to aggregated commands execution failure!, and the router's host agent answers anAggregationControlCommandFinish withjava.lang.NullPointerException: Cannot invoke "java.util.Queue.clear()" because "queue" is null. - In our lab run, 12 of 24 parallel tier deploys failed. In two of three rounds, the two routers ended up with different keepalived VIP sets, and both were PRIMARY.
What to do about it?
- On the agent:
- do not replace an existing queue on Start;
- do not fail with an NPE on a Finish whose queue was already applied;
- make the maps thread-safe.
- A complete fix would serialise aggregated applies per router on the management server, or tag each aggregation with an id. That is a larger change.
- Lenguaje dominante
- Java
- Estrellas
- 3.1k
- Forks
- 1.4k
- Merge medio
- 7 d 16 h
- PR fusionados (30 d)
- 15
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/cloudstack
-
resizeVolume of a running system VM's volume is accepted but the VM never sees the new sizePosiblemente ocupada @bhouse-nexthop la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/cloudstack#14645 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
VR reports a load balancer change as applied when haproxy.cfg cannot be replacedPosiblemente ocupada @bhouse-nexthop la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/cloudstack#14633 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
restartNetwork reports a ResourceUnavailableException as an unexpected error (530), unlike restartVPC (534)Posiblemente ocupada @bhouse-nexthop la tomó hace 3 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
apache/cloudstack#14631 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
apache/cloudstack#14625 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Remote access VPN users are disconnected on every LB, ACL, port forward or firewall change (xl2tpd restarted on every iptables pass)Posiblemente ocupada @willbennett-devops la tomó hace 12 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
apache/cloudstack#14545 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/cloudstack
Issues similares
-
[Bug]: Nullable implicit operator on string extensible enums still throws for a null stringPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug emitter:client:csharp
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
microsoft/typespec#12572 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[BUG]: Java SDK MountRequest always sends update-optional fields, resetting stored mount settingsAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
GCC 15.2: -Wcast-qual warning - cast discards const qualifier from pointer target type (H5trace.c)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 73/100
Los mantenedores suelen responder en 1 día
-
[Bug] RemotingHelper.connect swaps the socket send and receive buffer configurationPosiblemente ocupada @amalsaidov la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
needs-area-label
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días