Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saw the following stack trace while selfhosting #16509

Closed
alexdima opened this issue Dec 5, 2016 · 9 comments · Fixed by #19537
Closed

Saw the following stack trace while selfhosting #16509

alexdima opened this issue Dec 5, 2016 · 9 comments · Fixed by #19537
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded workbench-hot-exit Preservation of unsaved changes across restarts
Milestone

Comments

@alexdima
Copy link
Member

alexdima commented Dec 5, 2016

I didn't do anything special at the time (i.e. I was typing in a TypeScript file, right after typing in keybindings.json). I have the following settings:

// Place your settings in this file to overwrite the default settings
{
	"editor.fontFamily": "Hack",
	"editor.fontSize": 16,
	"editor.renderWhitespace": "boundary",
	"editor.renderIndentGuides": true,
	"files.autoSave": "afterDelay",
	"editor.renderLineHighlight": "gutter",
	"telemetry.enableTelemetry": false,
	"telemetry.enableCrashReporter": false
}
shell.ts:540 A system error occured (ENOENT: no such file or directory, stat 'c:\Users\alexdima\AppData\Roaming\Code - Insiders\Backups\ad08f2029706e72480f9216ce0db91d9\file\09c2dfdc538a2e9dc22c92d69ab27978'): Error: ENOENT: no such file or directory, stat 'c:\Users\alexdima\AppData\Roaming\Code - Insiders\Backups\ad08f2029706e72480f9216ce0db91d9\file\09c2dfdc538a2e9dc22c92d69ab27978'
    at Error (native)e.onUnexpectedError @ shell.ts:540
(anonymous function) @ shell.ts:456
e.onUnexpectedError @ errors.ts:68
o @ errors.ts:88done @ winjs.base.raw.js:1378
v @ winjs.base.raw.js:1224enter @ winjs.base.raw.js:901
_run @ winjs.base.raw.js:1068
_chainedError @ winjs.base.raw.js:1031
n @ winjs.base.raw.js:736
then @ winjs.base.raw.js:1436
enter @ winjs.base.raw.js:747
_run @ winjs.base.raw.js:1068
_setCompleteValue @ winjs.base.raw.js:1052
v @ winjs.base.raw.js:1209
enter @ winjs.base.raw.js:901
_run @ winjs.base.raw.js:1068
_error @ winjs.base.raw.js:1041
(anonymous function) @ async.ts:654
(anonymous function) @ original-fs.js:123

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug workbench-hot-exit Preservation of unsaved changes across restarts labels Dec 5, 2016
@bpasero
Copy link
Member

bpasero commented Dec 5, 2016

@alexandrudima to be clear, this error was only showing up in dev tools but not shown to you via error message right?

@bpasero bpasero added this to the November 2016 milestone Dec 5, 2016
@Tyriar
Copy link
Member

Tyriar commented Dec 5, 2016

Having difficulty reproducing but my guess is that this is a race condition when auto save is on since the default delay is the same as the backup's delay (1000ms). @bpasero unless you think it's something else, how about we disabling all backups for text files when afterDelay is on?

@Tyriar
Copy link
Member

Tyriar commented Dec 5, 2016

I also hit this, I had auto save on at the time:

shell.ts:540A system error occured (ENOENT: no such file or directory, stat '/home/daimms/.config/Code - Insiders/Backups/45f8cb37345e6af816edadc2d14de789/file/fd1efab8f93adb9063c41d598b09ccaa'): Error: ENOENT: no such file or directory, stat '/home/daimms/.config/Code - Insiders/Backups/45f8cb37345e6af816edadc2d14de789/file/fd1efab8f93adb9063c41d598b09ccaa'
    at Error (native)

No error on UI.

@alexdima
Copy link
Member Author

alexdima commented Dec 5, 2016

@bpasero Yeah, saw it in dev tools, not in an error popup

@bpasero
Copy link
Member

bpasero commented Dec 7, 2016

@Tyriar when I look at how discardResourceBackup and backupResource are triggered in backupModelTracker I think you will always have a chance to hit this if someone manages to save the file (which will trigger discardResourceBackup) while the backup is being made. The reason is that backupResource is not an atomic operation, it has a chance of being in the middle of work while discardResourceBackup is kicking in.

Since it is currently not possible to cancel any running backupResource call, maybe it would be best to check for both discardResourceBackup and backupResource if there are pending operations on the resource, and queue them up in a clever way?

As for auto save: hot exit for auto save enabled does not add much value because upon quit we save all dirty files if any of the auto save configurations is enabled. Basically you will never see a confirm dialog on quit, unless you have untitled files opened.

Now, if we take out backups when auto save is enabled, we would probably solve this issue for the 90% case. However, doing so would also mean that there is no backups being made for people that have auto save on. If you happen to configure auto save onWindowFocusLost and have many dirty files and hit a crash, you still loose your data.

I agree though that with auto save after 1 second, backups are not making much sense...

@bpasero bpasero removed their assignment Dec 7, 2016
@Tyriar
Copy link
Member

Tyriar commented Dec 7, 2016

@bpasero for the auto save case I'm suggesting only disable text file backups when it's set to afterDelay.

Proposed actions:

  • Make discard and backup go through a queue
  • Disable text file backups when files.autoSave is afterDelay and files.autoSaveDelay <= TextFileEditorModel.DEFAULT_CONTENT_CHANGE_BUFFER_DELAY

@Tyriar
Copy link
Member

Tyriar commented Dec 8, 2016

I made the auto save change, let's push the queue out to Jan as I don't think it's critical enough to get fixed at this point.

@aeschli
Copy link
Contributor

aeschli commented Feb 24, 2017

@bpasero Are there steps to verify?

@bpasero
Copy link
Member

bpasero commented Feb 24, 2017

No, I think we should mark this as verified given it was not reported again in a while.

@bpasero bpasero added the verified Verification succeeded label Feb 24, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded workbench-hot-exit Preservation of unsaved changes across restarts
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants