You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue occur when all extensions are disabled?: Yes
VS Code Version: 1.75.0
OS Version: Darwin x64 21.6.0
Steps to Reproduce:
Create a new extension and call https.get or https.request with an agent set to keep connections alive
Change your http.proxySupport setting to override (the default)
Observe that connections are not being reused. This has performance implications as creating sockets is not cheap.
The following code snippet should help demonstrate this problem with notes describing what conditions are needed for connections to persist:
constopt: https.RequestOptions={host: 'example.com',port: 443,agent: newhttps.Agent({keepAlive: true,keepAliveMsecs: 60000,}),// Explicit headers because something is clobbering the agent's `keepAlive` option// Omitting this causes all connections to close regardless of `http.proxySupport`headers: {Connection: 'keep-alive'}}https.get(opt,r1=>{// Without explicit header in `opt` -> `close`// With explicit header in `opt` -> `undefined` (implies keep the connection alive)console.log('first request connection header ->',r1.headers.connection)// Consume data so we can use the socket againr1.on('data',()=>{})r1.on('end',()=>{https.get(opt,r2=>{// `http.proxySupport` set to `override` -> always `false`// `http.proxySupport` set to `off` with no header -> `false`// `http.proxySupport` set to `off` AND explicit header -> `true`console.log('did reuse socket ->',(r2asany).req.reusedSocket)})})})
This issue likely originates from here. I'm not entirely sure why an explicit header is needed, but it might be because the proxy patch bypasses logic that would normally set the header. This line appears to be called even when http.proxySupport is set to off.
The text was updated successfully, but these errors were encountered:
Problem:
[microsoft/vscode#173861](microsoft/vscode#173861)
Solution:
Inject http agent only for the GenerateCompletions API, do this per IDE session.
Tested and verified:
1. This inject won't happen for any other API calls. It only applies to
GenerateCompletions API when user is NOT using `http.proxy` vscode feature.
2. No regression found with Toolkit features or CodeWhisperer features.
3. Regardless of user VSC proxy setting `http.proxySupport`, it still enables HTTP connection reuse.
4. Tested in AWS Cloud9.
chrmarti
added
bug
Issue identified by VS Code Team member as probable bug
proxy
Issues regarding network proxies
labels
Dec 5, 2023
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
https.get
orhttps.request
with an agent set to keep connections alivehttp.proxySupport
setting tooverride
(the default)The following code snippet should help demonstrate this problem with notes describing what conditions are needed for connections to persist:
This issue likely originates from here. I'm not entirely sure why an explicit header is needed, but it might be because the proxy patch bypasses logic that would normally set the header. This line appears to be called even when
http.proxySupport
is set tooff
.The text was updated successfully, but these errors were encountered: