title: ASP.NET Core 3.1 HttpMessageHandler cleanup cycle
body: <p>I see these messages in my debug log:</p>
  <blockquote>
  <p>[23:29:12 DBG] HttpMessageHandler expired after 120000ms for client 'default' {&quot;EventId&quot;: {&quot;Id&quot;: 103, &quot;Name&quot;: &quot;HandlerExpired&quot;}, &quot;SourceContext&quot;: &quot;Microsoft.Extensions.Http.DefaultHttpClientFactory&quot;}</p>
  </blockquote>
  <blockquote>
  <p>[23:29:22 DBG] Starting HttpMessageHandler cleanup cycle with 1 items {&quot;EventId&quot;: {&quot;Id&quot;: 100, &quot;Name&quot;: &quot;CleanupCycleStart&quot;}, &quot;SourceContext&quot;: &quot;Microsoft.Extensions.Http.DefaultHttpClientFactory&quot;}</p>
  </blockquote>
  <blockquote>
  <p>[23:29:22 DBG] Ending HttpMessageHandler cleanup cycle after 1.9126ms - processed: 0 items - remaining: 1 items {&quot;EventId&quot;: {&quot;Id&quot;: 101, &quot;Name&quot;: &quot;CleanupCycleEnd&quot;}, &quot;SourceContext&quot;: &quot;Microsoft.Extensions.Http.DefaultHttpClientFactory&quot;}</p>
  </blockquote>
  <blockquote>
  <p>[23:29:32 DBG] Starting HttpMessageHandler cleanup cycle with 1 items {&quot;EventId&quot;: {&quot;Id&quot;: 100, &quot;Name&quot;: &quot;CleanupCycleStart&quot;}, &quot;SourceContext&quot;: &quot;Microsoft.Extensions.Http.DefaultHttpClientFactory&quot;}</p>
  </blockquote>
  <blockquote>
  <p>[23:29:32 DBG] Ending HttpMessageHandler cleanup cycle after 0.1306ms - processed: 0 items - remaining: 1 items {&quot;EventId&quot;: {&quot;Id&quot;: 101, &quot;Name&quot;: &quot;CleanupCycleEnd&quot;}, &quot;SourceContext&quot;: &quot;Microsoft.Extensions.Http.DefaultHttpClientFactory&quot;}</p>
  </blockquote>
  <p>These messages never end, but I do not use any of those in my application.  I have some undisposed object, why do I always have one item?</p>
  <p>This is my code in <code>Startup.cs</code>:</p>
  <pre><code>services.AddHttpClient(&quot;default&quot;, c =&gt;
          {
              c.DefaultRequestHeaders.Add(&quot;Accept-Encoding&quot;, &quot;gzip, deflate&quot;);
              c.Timeout = TimeSpan.FromMinutes(120);
          }).ConfigurePrimaryHttpMessageHandler(() =&gt; new HttpClientHandler
          {
              Proxy = WebRequest.DefaultWebProxy,
              AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip
          });
  </code></pre>