title: Polly Bulkhead unexpected behavior when using in ASP.NET Core
body: <p>This is my bulkhead policy:</p>
  <pre><code>BulkheadPolicy = Policy
      .BulkheadAsync(maxParallelization: 2,
          maxQueuingActions: 2, onBulkheadRejectedAsync: (context) =&gt;
          {
              Console.WriteLine(&quot;Rejected&quot;);
              return Task.CompletedTask;
          });         
  </code></pre>
  <p>It should allow only 4 concurrent tasks to execute/wait for execution.<br />
  However, I end up getting 6 tasks being able to run through the bulkhead policy.</p>
  <p>This is my controller action:</p>
  <pre><code>[HttpGet(&quot;bulkhead&quot;)]
  public async Task&lt;object&gt; Bulkhead()
  {
      Console.WriteLine(DateTime.UtcNow);
  
      var bhCount = _policyManager.BulkheadPolicy.BulkheadAvailableCount;
      var queueCount = _policyManager.BulkheadPolicy.QueueAvailableCount;
  
      // The policy is used here
      await _policyManager.BulkheadPolicy.ExecuteAsync(async (context) =&gt;
      {
          await Task.Delay(10000);
      }, new Context());
  
      return new
      {
          bhCount,
          queueCount
      };
  }
  
  </code></pre>
  <p>In my browser, I used this script to simulate 14 concurrent tasks:</p>
  <pre class="lang-js prettyprint-override"><code>for (var i = 0; i &lt; 14; i++) {
      fetch('https://localhost:44313/api/Bulkheads/bulkhead')
          .then(result=&gt;console.log(result));
  }
  </code></pre>
  <p>which should produce only 4 <code>200OK</code> responses. However, I end up getting 6 <code>200OK</code> responses.
  I ran the test many times and got the same result. Does anybody have an idea why since the same behavior works well with a console application? Did I miss something here? Many thanks.</p>
  <p><strong>UPDATE 1</strong>:
  This is my <code>IPolicyManager</code> interface</p>
  <pre><code>    public interface IPolicyManager
      {
          AsyncBulkheadPolicy BulkheadPolicy { get; }
      }
  
      public class PolicyManager : IPolicyManager
      {
          public PolicyManager()
          {
               Init();
          }
  
          public AsyncBulkheadPolicy BulkheadPolicy { get; private set; }
  
          private void Init()
          {
              BulkheadPolicy = Policy
                  .BulkheadAsync(maxParallelization: 2,
                      maxQueuingActions: 2, onBulkheadRejectedAsync: (context) =&gt;
                      {
                          Console.WriteLine(&quot;Rejected&quot;);
                          return Task.CompletedTask;
                      });
          }
      }
  </code></pre>
  <p><strong>UPDATE 2</strong>:
  When I send a fixed request (fixed URL), it failed quite slow, but when I append a random argument in the requests, the result is as expected (fail fast and only 4 requests can proceed).</p>
  <pre class="lang-js prettyprint-override"><code>for (var i = 0; i &lt; 14; i++) {
      fetch('https://localhost:44313/api/Bulkheads/bulkhead?count=' + i)
          .then(result=&gt;console.log(result));
  }
  </code></pre>