microsoft / microsoft/java-debug

Race condition at the end of hot code replacement causes inconsistent UI state

Abierto
#559 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

ai-triaged bug
Lenguaje dominante
Java
Estrellas
409
Forks
204
Merge medio
1 d 13 h
PR fusionados (30 d)
4

Descripción

At the end of JavaHotCodeReplaceProvider.redefineClasses() execution JavaHotCodeReplaceProvider.stepIntoThread(ThreadReference) is called which sends JDI StepRequest to the target process and subscribes for StepEvent, on reception of which the following events for the UI are populated in that order:
context.getProtocolServer().sendEvent(new Events.StoppedEvent("step", thread.uniqueID())); context.getProtocolServer().sendEvent(new Events.ContinuedEvent(thread.uniqueID()));

However, ProtocolServer.sendEvent(DebugEvent) usually reverses this order by putting StoppedEvent to the event queue until ProtocolServer command processing (redefineClasses in this case) has completed. All other types of events are sent immediately. As JDI StepRequest is usually processed very quickly by the target process, the usual order for the VS Code UI to receive the events is ContinuedEvent > StoppedEvent. In contrast, if StepRequest processing happens to be slow then StoppedEvent is sent first and ContinuedEvent as the final one. In that case the Debug toolbar in VS Code UI will be shown like in running state with Stop button while the target process is still suspended.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

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.

Línea de trabajo

Comienza con JavaHotCodeReplaceProvider.redefineClasses() y stepIntoThread(ThreadReference), y después inspecciona ProtocolServer.sendEvent(DebugEvent) y su gestión de StoppedEvent y ContinuedEvent. Reproduce o rastrea el momento de StepEvent, y considera que el issue está resuelto cuando la VS Code UI refleje de forma consistente que el proceso objetivo está suspendido después del reemplazo de código en caliente.

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

Evaluación

Stack tecnológico
java
Área
devtools
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.