The client should reuse HttpClient for negotiate and start requests #3829

Closed
moozzyk opened this Issue Dec 14, 2016 · 1 comment

Projects

None yet

1 participant

@moozzyk
Contributor
moozzyk commented Dec 14, 2016

Expected behavior

SignalR client reuses the same HttpClient for negotiate and start requests. All SSE and LongPolling connect/poll requests should use the same httpClient for long running requests

Actual behavior

SignalR client calls IHttpClient.Initialize before sending negotiate and start requests. The DefaultHttpClient creates httpClient in the Initialize method. Since start can be sent only after negotiate initializing the IHttpClient when starting the request should not be needed. Currently it resets the clients that were used to send the negotiate (which is short running) and connect (which is long running) requests. This may result in breaking sticky sessions in load balancers.

Steps to reproduce

@moozzyk moozzyk added a commit that referenced this issue Dec 14, 2016
@moozzyk moozzyk Removing extraneous call to IHttpClient.Initialize
An extraneous call to IHttpClient.Initialize when sending the start requests resets httpClients in the DefaultHttpClient. This may break load balancers and prevent reusing HTTPS connections (SSL negotation will happen twice - once for negotiate and once for start)

More: #3829
ecda163
@moozzyk moozzyk added a commit that referenced this issue Dec 22, 2016
@moozzyk moozzyk Removing extraneous call to IHttpClient.Initialize (#3830)
An extraneous call to IHttpClient.Initialize when sending the start requests resets httpClients in the DefaultHttpClient. This may break load balancers and prevent reusing HTTPS connections (SSL negotation will happen twice - once for negotiate and once for start)

More: #3829
0b362f6
@moozzyk moozzyk added the bug label Dec 22, 2016
@moozzyk moozzyk added this to the vNext milestone Dec 22, 2016
@moozzyk
Contributor
moozzyk commented Dec 22, 2016

Fixed in 0b362f6

@moozzyk moozzyk closed this Dec 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment