pnp / PnP

SharePoint / Office 365 Developer Patterns and Practices - Archived older solutions. Please see https://aka.ms/m365pnp for updated guidance
https://aka.ms/m365pnp
Other
1.9k stars 3.31k forks source link

HttpClient instantiated incorrectly in samples #1836

Open kaevans opened 5 years ago

kaevans commented 5 years ago

Category

[X ] Bug [ ] Enhancement

Environment

[ X] Office 365 / SharePoint Online [ X] SharePoint 2016 [ X] SharePoint 2013

Expected or Desired Behavior

Incorrect instantiation of HttpClient in samples.

See https://docs.microsoft.com/en-us/azure/architecture/antipatterns/improper-instantiation/ for an explanation of instantiating HttpClient within a method in a multi-threaded application.

Multiple instances of this found across samples in this repo.

https://github.com/SharePoint/PnP/search?q=new+httpclient&unscoped_q=new+httpclient

Observed Behavior

TCP resource exhaustion and application instability under load.

Steps to Reproduce

Load test a sample.