-
Notifications
You must be signed in to change notification settings - Fork 48
Reduce REST traffic for server-side folders #1532
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
base: master
Are you sure you want to change the base?
Reduce REST traffic for server-side folders #1532
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree that the .vscode folder support should be restricted to only the settings.json file. There is already value in being able to have a server-folder-specific launch.json file for debugging, .code-snippets file(s) and (to a lesser extent) tasks.json. Some extensions use .vscode/extensions to store stuff intended for sharing.
For this reason the suggested description of the /_vscode webapp at https://docs.intersystems.com/components/csp/docbook/DocBook.UI.Page.cls?KEY=GVSCO_serverflow#GVSCO_serverflow_folderspec is "Storage for VS Code namespace-specific settings, snippets, debug configurations etc."
Is this consistent with how Studio behaved? |
I believe so. I'm pretty sure Studio only "opens" the project when it loads or the project is switched.
VS Code probes the file system for these files constantly, and they never exist. This leads to a ton of junk traffic that clogs up debug logs and can pose problems for small user-based licenses if they cause the number of concurrent connections to rise above 25. I don't think that supporting other file types has value, regardless of the traffic impact. I only support doing this for |
If there's a problem with concurrent connections doesn't this indicate we're not providing a session cookie properly in some cases? What if the first time on a given connection the extension needs to check existence of .vscode/X.y it asks the server, then caches the name if it doesn't exist and thereafter uses the cache to avoid the REST call? If the user subsequently creates .vscode/X.y through VS Code and saves it to the server we'd remove its name from the cache. We could even do this for settings.json as long as users understand that after one member of the team creates that file for the first time for a shared namespace the other team members would need to reload their VS Code window, or reconnect. Alternatively we could treat settings.json as a special case and always test its existence on the server rather than adding it to the non-existence cache. |
We are properly using session cookies. The issue is that if a logged in user creates more than a certain number of concurrent connections, each of those connections will take out a license unit instead of them all sharing one unit. This can cause license usage to spike. Removing this traffic should help reduce the chances of that happening.
I would rather us make a decision on what we are going to support. I think that users advanced enough to set up the /_vscode web app are going to expect the stored settings to behave like the rest of VS Code settings and update dynamically. Therefore, I think we should allow the constant pinging of |
Using the Doc reference: https://code.visualstudio.com/docs/editing/userdefinedsnippets#_project-snippet-scope |
So can settings, and like settings there are scenarios where a debug config tailored to a specific namespace can be valuable. |
As for license starvation, I ran this experiment, starting with no VS Code instances open:
Can we do anything to release connections when closing VS Code? |
Thanks for the correction.
I just disagree that supporting these other files is valuable. AFAIK there aren't any external tools that depend on files other than settings.json. IMO it's strange architecturally that we persistent VS Code client configuration on the server. The "server-namespace" storage strategy doesn't neatly map to the "workspace folder" VS Code setting concept. I would prefer to not do this except for cases where it's needed, like settings.
I don't think this is the cause of that issue because it seems to be happening on open and without much user interaction. However, this may be something good for our extensions to do in the |
This PR was prompted by my investigation into #1523.
settings.json
within.vscode
to the server. None of the other files are likely to exist, and this is the only one that we explicitly support. VS Code hammers the file system looking for files within.vscode
so this change eliminates a lot of garbage traffic.GET /api/atelier/
every tie we try to read the root folder.OpenedDocument
UserAction once per workspace folder.