microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
164.06k stars 29.23k forks source link

Cannot exit since version 1.54.0 #119451

Closed xiaonanshen-ponyai closed 3 years ago

xiaonanshen-ponyai commented 3 years ago

Clicking on the close button has no effect. File -> Exit and CTRL+Q do not work as well. This also happens on fresh installation without any extension and anything opened. Downgrade to 1.53.x solves the problem.

Steps to Reproduce:

  1. Click on the close button

Does this issue occur when all extensions are disabled?: Yes

[main 2021-03-22T10:51:11.777Z] Lifecycle#window.on('close') - window ID 1
[main 2021-03-22T10:51:11.778Z] Lifecycle#unload() - window ID 1
[18894:0322/185111.780497:INFO:CONSOLE(626)] "%cTRACE color: #888 [lifecycle] onBeforeUnload (reason: 1)", source: file:///snap/code-insiders/661/usr/share/code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (626)
[18894:0322/185111.782592:INFO:CONSOLE(626)] "%cTRACE color: #888 [lifecycle] onBeforeUnload continues without veto", source: file:///snap/code-insiders/661/usr/share/code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (626)
[main 2021-03-22T10:51:11.784Z] Lifecycle#unload() - no veto (window ID 1)
[18894:0322/185111.786123:INFO:CONSOLE(626)] "%cTRACE color: #888 [lifecycle] onWillUnload (reason: 1)", source: file:///snap/code-insiders/661/usr/share/code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (626)
[18894:0322/185116.791773:INFO:CONSOLE(626)] "%c WARN color: #993 [lifecycle] onWillShutdown is taking a long time, pending operations: join.closeStorage", source: file:///snap/code-insiders/661/usr/share/code-insiders/resources/app/out/vs/workbench/workbench.desktop.main.js (626)
vscodebot[bot] commented 3 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

bpasero commented 3 years ago

Culprit seems to be SQLite storage:

onWillShutdown is taking a long time, pending operations: join.closeStorage

I also see you are using the Snap version. Could you try the same with our Zip archive to see if it is related to snap or not: https://az764295.vo.msecnd.net/stable/2b9aebd5354a3629c3aba0a5f5df49f43d6689f8/code-stable-x64-1615806628.tar.gz

xiaonanshen-ponyai commented 3 years ago

The problem exists in the Zip version as well.

bpasero commented 3 years ago

Can you try to run code --disable-extensions --user-data-dir <directory> where <directory> is an empty folder? This will ensure Code is starting with a fresh data directory, e.g. no specific settings and without any extensions running.

xiaonanshen-ponyai commented 3 years ago

Tried that. No luck. Still not working.

bpasero commented 3 years ago

Is there anything special about your filesystem that could have an impact?

xiaonanshen-ponyai commented 3 years ago

No I don't think so.

bpasero commented 3 years ago

At this point I am pretty much clueless and I have not heard from anyone else facing this issue. On close of a window we want to normally shutdown our SQLite connection used for persisting UI state. For some reason this seems to be taking more than 5s on your machine. Does it ever eventually finish or hangs forever?

Does it make any difference if you do File - Exit compared to opening 2 windows and just closing 1 window with the X? Does it reproduce when you close an empty window (from File - New Window)?

xiaonanshen-ponyai commented 3 years ago

It just hangs forever. I've tried using File - Exit, tried closing 1 window with multiple windows opened, tried closing empty window. None of them works.

bpasero commented 3 years ago

Can you maybe send me or attach the entire logs folder, I wonder if there is more. Ideally to it from a fresh --user-data-dir to have isolated logs. The logs folder is within.

xiaonanshen-ponyai commented 3 years ago

logs.tar.gz Here is the logs folder. I run vscode using code --disable-extensions --user-data-dir <directory> and try to close it using the x button. And terminate it using CTRL-C in terminal after a while. To me, it seems that there is nothing related.

bpasero commented 3 years ago

This one is also a bit suspicious:

[error] Extension host terminated unexpectedly

Can you do the same running with --verbose this time, again from a fresh user data dir? That should produce a lot more output.

xiaonanshen-ponyai commented 3 years ago

logs.tar.gz Seems the error you mentioned above happened after I CTRL-C to terminate VSCode so it seems unrelated. Here is the logs folder running with --verbose and before terminating.

bpasero commented 3 years ago

Thanks, I don't see anything suspicious.

Would you be able to setup your machine to run VSCode out of sources to conduct some more testing? I understand if that is not possible, but then I fear I need to wait for more users to chime in to give more information if possible.

xiaonanshen-ponyai commented 3 years ago

I cannot do much on the company-owned laptop. I'll try to setup a similar environment on my own laptop and see if I can reproduce this problem.

bpasero commented 3 years ago

That would be great 👍

viper0n commented 3 years ago

@bpasero I pretty much have the same issue.

CentOS Linux release 7.6.1810 (Core) Version: rkhunter-1.4.4 VS Code Version 1.54.3

this is me just spamming the close button

[main 2021-04-14T19:56:07.851Z] Lifecycle#unload() - no veto (window ID 1)
[124657:0414/155607.852997:INFO:CONSOLE(626)] "%cTRACE color: #888 [lifecycle] onWillUnload (reason: 1)", source: file:///home/nmanohar/vscode/VSCode-linux-x64/resources/app/out/vs/workbench/workbench.desktop.main.js (626)
[main 2021-04-14T19:56:08.612Z] Lifecycle#window.on('close') - window ID 1
[main 2021-04-14T19:56:08.612Z] Lifecycle#unload() - window ID 1
[124657:0414/155608.613636:INFO:CONSOLE(626)] "%cTRACE color: #888 [lifecycle] onBeforeUnload (reason: 1)", source: file:///home/nmanohar/vscode/VSCode-linux-x64/resources/app/out/vs/workbench/workbench.desktop.main.js (626)
[124657:0414/155608.614847:INFO:CONSOLE(626)] "%cTRACE color: #888 [lifecycle] onBeforeUnload continues without veto", source: file:///home/nmanohar/vscode/VSCode-linux-x64/resources/app/out/vs/workbench/workbench.desktop.main.js (626)
[main 2021-04-14T19:56:08.615Z] Lifecycle#unload() - no veto (window ID 1)
[124657:0414/155608.615853:INFO:CONSOLE(626)] "%cTRACE color: #888 [lifecycle] onWillUnload (reason: 1)", source: file:///home/nmanohar/vscode/VSCode-linux-x64/resources/app/out/vs/workbench/workbench.desktop.main.js (626)
[124657:0414/155612.297081:INFO:CONSOLE(626)] "%c WARN color: #993 [lifecycle] onWillShutdown is taking a long time, pending operations: join.closeStorage", source: file:///home/nmanohar/vscode/VSCode-linux-x64/resources/app/out/vs/workbench/workbench.desktop.main.js (626)
[124657:0414/155612.853749:INFO:CONSOLE(626)] "%c WARN color: #993 [lifecycle] onWillShutdown is taking a long time, pending operations: join.closeStorage", source: file:///home/nmanohar/vscode/VSCode-linux-x64/resources/app/out/vs/workbench/workbench.desktop.main.js (626)
[124657:0414/155613.617125:INFO:CONSOLE(626)] "%c WARN color: #993 [lifecycle] onWillShutdown is taking a long time, pending operations: join.closeStorage", source: file:///home/nmanohar/vscode/VSCode-linux-x64/resources/app/out/vs/workbench/workbench.desktop.main.js (626)

Using the Ctrl+Q

[124657:0414/160028.496499:INFO:CONSOLE(626)] "%cTRACE color: #888 KeybindingService#dispatch Ctrl+Q workbench.action.quit", source: file:///home/nmanohar/vscode/VSCode-linux-x64/resources/app/out/vs/workbench/workbench.desktop.main.js (626)
[124657:0414/160028.497831:INFO:CONSOLE(626)] "%cTRACE color: #888 CommandService#executeCommand workbench.action.quit", source: file:///home/nmanohar/vscode/VSCode-linux-x64/resources/app/out/vs/workbench/workbench.desktop.main.js (626)

using the version from tar.gz

I switched to an old build 1.53.2 to test. Exits fine here