I was wondering if anyone has a clue to what is going on here and can point me in the right direction.
Ok..lets put the code in context.
I have ajax (jquery) methods:
$xmlHttp("/Api/GetWaitingMessages", { count: 20 }) .always(processResult);
($ xmlHttp just wraps jQuery aside and some basic $ ajax options)
And in our health control I see things like this:
Exception information: Exception type: System.ArgumentException Exception message: The parameters dictionary contains a null entry for parameter 'count' of non-nullable type 'System.Int32' for method 'System.Web.Mvc.ActionResult GetWaitingMessages(Int32)' in 'AjaxController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter. Parameter name: parameters
Now the thing is, I put some traces and tried / caught (for testing) to make sure jQuery never calls GetWaitingMessages with empty or undefined "count", but with regard to healthmonitoring exceptions: GetWaitingMessages instance and passed the value null as a parameter. (from what I understand, MVC creates methods through reflection)
btw: an error occurs only, for example, from several thousand requests
Signature GetWaitingMessages:
public virtual ActionResult GetWaitingMessages(int count) { .... }
So, suppose mvc should not even hit the method, since there should be no signature match.
Does MVC have problems with high traffic websites (i.e. problems with multiple threads)?
The site mentioned above runs on a cluster of 5 web farm servers with network load balancing and IP affinity.
Each server receives about 1500 requests / sec at different times.
The site uses URL rewriting to display domains in the domain (i.e. test.com will just insert / check the URL), as it is a site with bright and multilingual white labels.
Additional site configuration information:
The controller that serves ajax requests is decorated
[SessionState(SessionStateBehavior.Disabled)]
HttpModules, where it is considered useless when it is deleted, since we need to run: runAllManagedModulesForAllRequests = "true" in MVC. I could set runAllManagedModulesForAllRequests = "false" and then try to figure out what to add, in what order, but it was easier just to delete what I know is not significant.
<remove name="AnonymousIdentification" /> <remove name="Profile" /> <remove name="WindowsAuthentication" /> <remove name="UrlMappingsModule" /> <remove name="FileAuthorization" /> <remove name="RoleManager" /> <remove name="Session" /> <remove name="UrlAuthorization" /> <remove name="ScriptModule-4.0" /> <remove name="FormsAuthentication" />
All are activated and configured in the web.config file
<pages validateRequest="false" enableEventValidation="false" enableViewStateMac="true" clientIDMode="Static"> and also: urlCompression staticContent caching outputCache
EDIT: Just parsed my trace logs a bit more. When an error occurs, I see (Content-Length: 8) that matches (count = 20). However, I do not see any query parameters in the logs. I dumped the HttpInputStream into the logs and it is completely empty .. but, as I just mentioned, the logs also say that Content-Length = 8, so something is wrong here.
Can IIS (end up rewriting URLs) mix it somewhere along the way?
-
Any help would be greatly appreciated. I will tear my hair, trying to understand what might be wrong here.
Thanks Robert