title: Locust: unexpected keyword argument 'user_count'
body: <p>I have a <code>locust</code> test that terminates successfully with all of the <code>environment.stats</code> that I specify being met.
  Nevertheless, something is causing <code>locust</code> to end with <code>code 2</code>.</p>
  <p>Here is the final output.</p>
  <p>Note: the <code>kill pid</code> is a separate process that just goes and gets Windows Perf Counter data, not related to <code>locust</code>.</p>
  <pre><code>[2021-09-22 14:30:43,061] ILGUYL-LT1/ERROR/root: Uncaught exception in event handler:
  Traceback (most recent call last):
    File &quot;c:\git\xxx\venv\lib\site-packages\locust\event.py&quot;, line 40, in fire
      handler(**kwargs)
  TypeError: on_spawning_complete() got an unexpected keyword argument 'user_count'
  
  
  
  [2021-09-22 13:58:05,889] xxx-LT1/INFO/locust.runners: 90 Users have been stopped, 0 still running
  kill pid:  21068
  [2021-09-22 13:58:05,893] xxx-LT1/INFO/locust.main: Running teardowns...
  [2021-09-22 13:58:05,895] xxx-LT1/INFO/locust.main: Shutting down (exit code 2), bye.
  [2021-09-22 13:58:05,896] xxx-LT1/INFO/locust.main: Cleaning up runner...
   Name                                                          # reqs      # fails  |     Avg     Min     Max  Median  |   req/s failures/s
  --------------------------------------------------------------------------------------------------------------------------------------------
   POST /aesFull.asp                                              10790    11(0.10%)  |    1950      11   19219    1500  |   38.19    0.04
  --------------------------------------------------------------------------------------------------------------------------------------------
   Aggregated                                                     10790    11(0.10%)  |    1950      11   19219    1500  |   38.19    0.04
  
  Response time percentiles (approximated)
   Type     Name                                                              50%    66%    75%    80%    90%    95%    98%    99%  99.9% 99.99%   100% # reqs
  --------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
   POST     /aesFull.asp                                                     1500   2100   2500   2700   3800   5100   7700  10000  17000  19000  19000  10790
  --------|------------------------------------------------------------|---------|------|------|------|------|------|------|------|------|------|------|------|
   None     Aggregated                                                       1500   2100   2500   2700   3800   5100   7700  10000  17000  19000  19000  10790
  
  Error report
   # occurrences      Error
  --------------------------------------------------------------------------------------------------------------------------------------------
   7                  POST /aesFull.asp: CatchResponseError('xxx response has no xxx ID, possibly non-valid input')
   4                  POST /aesFull.asp: CatchResponseError('xxxxx response code error')
  --------------------------------------------------------------------------------------------------------------------------------------------
  </code></pre>
  <p>On further investigation, found at the very top of the long log output an unhandled exception.</p>