microsoft / microsoft/java-debug

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

未關閉
#559 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

ai-triaged bug
主要語言
Java
星號
409
分支
204
平均合併
1 天 13 小時
30 天內合併 PR
4

描述

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.

貢獻指南

這個儲存庫沒有索引到貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 JavaHotCodeReplaceProvider.redefineClasses() 和 stepIntoThread(ThreadReference) 開始,接著檢查 ProtocolServer.sendEvent(DebugEvent) 以及它對 StoppedEvent 和 ContinuedEvent 的處理。重現或追蹤 StepEvent 的時序,並在 VS Code UI 能夠一致反映目標程序在熱程式碼替換後處於暫停狀態時,視為該 issue 已完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
java
領域
devtools
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。