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

Settings sync should debounce requests when a request is in progress #91286

Closed
Tyriar opened this issue Feb 24, 2020 · 4 comments
Closed

Settings sync should debounce requests when a request is in progress #91286

Tyriar opened this issue Feb 24, 2020 · 4 comments
Assignees
Labels
feature-request Request for new features or functionality on-testplan settings-sync
Milestone

Comments

@Tyriar
Copy link
Member

Tyriar commented Feb 24, 2020

On a slow responding server, several requests get fired before proceeding ones have finished. For the following log I think the behavior should be:

[2020-02-24 07:29:36.999] Fire sync request
[2020-02-24 07:29:58.309] Queue a request
[2020-02-24 07:30:06.612] Queue a request (does nothing, one's already queued)
[2020-02-24 07:30:08.798] Queue a request (does nothing, one's already queued)
[2020-02-24 07:30:10.024] Queue a request (does nothing, one's already queued)
[2020-02-24 07:30:12.788] Queue a request (does nothing, one's already queued)
[2020-02-24 07:30:38.955] Queue a request (does nothing, one's already queued)
[2020-02-24 07:31:36.999] Abandon request as it's taken over 2 minutes
[2020-02-24 07:31:36.999] Fire sync request as it has been queued
[2020-02-24 07:31:51.136] Queue a request (does nothing, one's already queued)
[2020-02-24 07:31:52.629] Queue a request (does nothing, one's already queued)
[2020-02-24 07:32:09.359] Queue a request (does nothing, one's already queued)
[2020-02-24 07:32:12.146] Queue a request (does nothing, one's already queued)
...

Actual sync log:

[2020-02-24 07:29:36.999] [userDataSync] [info] Auto Sync: Triggered.
[2020-02-24 07:29:58.309] [userDataSync] [info] Auto Sync: Triggered.
[2020-02-24 07:30:06.612] [userDataSync] [info] Auto Sync: Triggered.
[2020-02-24 07:30:08.798] [userDataSync] [info] Auto Sync: Triggered.
[2020-02-24 07:30:10.024] [userDataSync] [info] Auto Sync: Triggered.
[2020-02-24 07:30:12.788] [userDataSync] [info] Auto Sync: Triggered.
[2020-02-24 07:30:38.955] [userDataSync] [info] Auto Sync: Triggered.
[2020-02-24 07:31:51.136] [userDataSync] [info] Auto Sync: Triggered.
[2020-02-24 07:31:52.629] [userDataSync] [info] Auto Sync: Triggered.
[2020-02-24 07:32:09.359] [userDataSync] [info] Auto Sync: Triggered.
[2020-02-24 07:32:12.146] [userDataSync] [info] Auto Sync: Triggered.
[2020-02-24 07:32:18.444] [userDataSync] [error] Unknown (UserDataSyncError) undefined: Server returned 500
    at d.manifest (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:446:798)
    at async m.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:441:8)
    at async l.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:431:979)
[2020-02-24 07:32:26.674] [userDataSync] [error] Unknown (UserDataSyncError) undefined: Server returned 500
    at d.manifest (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:446:798)
    at async m.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:441:8)
    at async l.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:431:979)
[2020-02-24 07:32:28.864] [userDataSync] [error] Unknown (UserDataSyncError) undefined: Server returned 500
    at d.manifest (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:446:798)
    at async m.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:441:8)
    at async l.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:431:979)
[2020-02-24 07:32:30.082] [userDataSync] [error] Unknown (UserDataSyncError) undefined: Server returned 500
    at d.manifest (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:446:798)
    at async m.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:441:8)
    at async l.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:431:979)
[2020-02-24 07:32:32.854] [userDataSync] [error] Unknown (UserDataSyncError) undefined: Server returned 500
    at d.manifest (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:446:798)
    at async m.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:441:8)
    at async l.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:431:979)
[2020-02-24 07:32:59.021] [userDataSync] [error] Unknown (UserDataSyncError) undefined: Server returned 500
    at d.manifest (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:446:798)
    at async m.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:441:8)
    at async l.sync (file:///C:/Users/daimms.REDMOND/AppData/Local/Programs/Microsoft VS Code Insiders/resources/app/out/vs/code/electron-browser/sharedProcess/sharedProcessMain.js:431:979)
@sandy081
Copy link
Member

Syncing each areas are queued but not the manifest request.

@sandy081 sandy081 added the feature-request Request for new features or functionality label Feb 25, 2020
@sandy081 sandy081 added this to the March 2020 milestone Feb 25, 2020
@sandy081 sandy081 modified the milestones: March 2020, April 2020 Mar 30, 2020
@sandy081 sandy081 modified the milestones: April 2020, Backlog Apr 28, 2020
@ericblade
Copy link

FWIW -- I just activated Settings Sync on what used to be my main machine, but I've been using a different one for quite a while. My newer machine picked up all the settings and extensions that I never bothered to install on it, which lead to a continuous repeating crash in Extension Host.

To attempt to nail down which extension was at fault, I went through the entire extensions list (about 120 extensions) and disabled them individually. At some point during this, VSCode threw up a warning that I was blocked from settings sync for spamming it.

Therefore, I think that debounce is really something that needs to be added.. I shouldn't be able to spam the server to the point where I'm locked out because I'm trying to fix the app being broken. :-)

@sandy081
Copy link
Member

sandy081 commented Sep 3, 2020

Currently requests are queued but not debounced. Will improve it.

sandy081 added a commit that referenced this issue Jan 21, 2022
@sandy081 sandy081 modified the milestones: Backlog, January 2022 Jan 24, 2022
@sandy081
Copy link
Member

Each Settings Sync activity is debounced for 2 seconds and queued until the current sync is finished. Also when if the client manages to exceed the client side rate limit, settings sync is suspended until restarting VS Code.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality on-testplan settings-sync
Projects
None yet
Development

No branches or pull requests

3 participants