julia-vscode / julia-vscode

Julia extension for Visual Studio Code
https://www.julia-vscode.org/
Other
1.29k stars 205 forks source link

Long running tasks crash Julia session #3674

Open alyst opened 3 months ago

alyst commented 3 months ago

It seems if my Julia REPL session (running within tmux) is connected to the vscode extension, long running tasks (say, 10h) confuse vscode extension, and it crashes my Julia session right after the task completes. If I disconnect vscode from the REPL, the command executes and does not crash. (And there were some vscode window reloads and disconnect from the server in between, but these things don't crash shorter-running tasks)

Here's the trace (Julia 1.10.4, vscode extension v1.105.2):

julia> ┌ Error: Some Julia code in the VS Code extension crashed
└ @ VSCodeServer ~/.vscode-server/extensions/julialang.language-julia-1.105.2/scripts/error_handler.jl:15
ERROR: Endpoint is not running, the current state is closed.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] check_dead_endpoint!
   @ ~/.vscode-server/extensions/julialang.language-julia-1.105.2/scripts/packages/JSONRPC/src/core.jl:344 [inlined]
 [3] send_success_response(endpoint::VSCodeServer.JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, original_request::Dict{String, Any}, result::VSCodeServer.ReplRunCodeRequestReturn)
   @ VSCodeServer.JSONRPC ~/.vscode-server/extensions/julialang.language-julia-1.105.2/scripts/packages/JSONRPC/src/core.jl:298
 [4] dispatch_msg(x::VSCodeServer.JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::VSCodeServer.JSONRPC.MsgDispatcher, msg::Dict{String, Any})
   @ VSCodeServer.JSONRPC ~/.vscode-server/extensions/julialang.language-julia-1.105.2/scripts/packages/JSONRPC/src/typed.jl:73
 [5] dispatch_msg(conn_endpoint::Base.RefValue{Union{Nothing, VSCodeServer.JSONRPC.JSONRPCEndpoint}}, msg_dispatcher::VSCodeServer.JSONRPC.MsgDispatcher, msg::Dict{String, Any}, is_dev::Bool)
   @ VSCodeServer ~/.vscode-server/extensions/julialang.language-julia-1.105.2/scripts/packages/VSCodeServer/src/VSCodeServer.jl:105
 [6] (::VSCodeServer.var"#234#236"{VSCodeServer.JSONRPC.MsgDispatcher, Dict{String, Any}, Bool, var"#511#512"})()
   @ VSCodeServer ~/.vscode-server/extensions/julialang.language-julia-1.105.2/scripts/packages/VSCodeServer/src/VSCodeServer.jl:155
xgdgsc commented 3 months ago

Same here. In my case the REPL is not running any task, just idle. I have several laptops on Windows/macOS and I switch between them and reload vscode windows and it happens.

xgdgsc commented 3 months ago

Also happens when I close the vscode window by accident during a long running task. And on window reopen and start REPL it runs fine, after the long running task finishes it crashes.

alyst commented 1 month ago

The issue is still there with the latest julia-vscode and Julia 1.11. Very annoying, as I keep forgetting to disconnect and keep loosing hours of calculations :'(