Web Connection
WC Module Error - Collection was modified
Gravatar is a globally recognized avatar based on your email address. WC Module Error - Collection was modified
  Carl Chambers
  All
  Feb 23, 2023 @ 11:30am

Hi Rick,

Trying to understand this error I found in the Web Connection Module Error Log.
The time of this error is about when I hot-swapped the EXE.
Would you expect to see this error if the Admin page was attempting to refresh the server list while the EXE was being replaced?

Thanks,
Carl

2023-02-23 00:10:13.722 - 29_631eaed6 - Unhandled Exception (Mainline): Collection was modified; enumeration operation may not execute.
   at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Enumerator.MoveNext()
   at Westwind.WebConnection.WebConnectionHandler.ShowServerList(StringBuilder output, Boolean noPerf)
   at Westwind.WebConnection.WebConnectionHandler.HandleAdminTasks()
   at Westwind.WebConnection.WebConnectionHandler.ProcessRequest(HttpContext context) - /admin/ShowServerList.wc?1677132616862
Gravatar is a globally recognized avatar based on your email address. re: WC Module Error - Collection was modified
  Rick Strahl
  Carl Chambers
  Feb 23, 2023 @ 05:45pm

If I had to guess overlapping requests that caused the list of servers to be modified:

  • You asked for Show Server List
  • While servers were being shut down

The list is a singleton in the app, so if it changes while you're reading from it, that's when you get the error. Should be very rare, but can happen more frequently if you have the server admin page open with the server list auto-refreshing frequently.

It's nothing to worry about too much.

I should probably pull the list all at once instead of walking as I draw the table/XML/JSON as it's collecting perf data which is relatively slow. So the traversal can take a bit.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: WC Module Error - Collection was modified
  Carl Chambers
  Rick Strahl
  Feb 23, 2023 @ 08:25pm

Thanks, Rick.

Carl

© 1996-2024