I am running SignalR in a Windows Load Balanced environment (clustered) and getting a rather significant numbers of connection lost errors.
Error messages read: invalid viewstate, connection dropped.
Seems as if SignalR is corrupting my viewstate when inside the cluster; worked great on a single server.
By default if you run SignalR in a farm and don;t change the message bus it won't work. Everything happens in memory and there's no magic that SignalR can figure out to make 2 machines communicate without extra work.
If you're already using a farm, I'm assuming you share a machnie key between the 2 machines otherwise nothing would work. (Not view state or anything that does encryption).
Today there's alpha (not ready for any type of real use) backplanes for SignalR to help with 1. 2. is what you're do for a normal ASP.NET app and SignalR shouldn't be special there.
If you have more details about 2. or any details about how the cluster is setup with SignalR (I'm not sure how signalr is affecting your view state) that would be great
not sure what you mean by 'message bus' or how to change it.
we are a normal ASP.NET WebForm app that does run on a cluster and does indeed share a machine key.
I just placed a simple usage of SignalR for evaluation/test purposes and began seeing the following 2 types of error messages in our logs:
1) The state information is invalid for this page and might be corrupted.System.Web.UI.ViewStateException: Invalid viewstate.
2) The client disconnected.System.Web.UI.ViewStateException: Invalid viewstate.
Both errors are followed by the same system/stack info:
=====================================================================================
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at System.Web.UI.ObjectStateFormatter.DeserializeType(SerializerBinaryReader reader)
=====================================================================================
I should add that this application started life in ASPNET 1.0 and has been migrated to ASPNET 4.0 runtime.
Visual Studio solution explorer provides some hint of this as it sometimes only yields certain context menu items
reminiscent
of the original environment it was created in. I have learned to live with it.
I have no idea why you get corrupted viewstate or what that has to do with SignalR. Provide us with repro steps and file a bug on github and we can look into it.
dm19898
Member
118 Points
24 Posts
Clustered or WebFarm environment
Mar 20, 2013 11:12 PM|LINK
I am running SignalR in a Windows Load Balanced environment (clustered) and getting a rather significant numbers of connection lost errors.
Error messages read: invalid viewstate, connection dropped.
Seems as if SignalR is corrupting my viewstate when inside the cluster; worked great on a single server.
anyone else run into this?
davidfowl
Contributor
2699 Points
611 Posts
Microsoft
Re: Clustered or WebFarm environment
Mar 21, 2013 06:13 PM|LINK
Here's a few things you should know:
Today there's alpha (not ready for any type of real use) backplanes for SignalR to help with 1. 2. is what you're do for a normal ASP.NET app and SignalR shouldn't be special there.
If you have more details about 2. or any details about how the cluster is setup with SignalR (I'm not sure how signalr is affecting your view state) that would be great
Senior SDE, ASP.NET Team, Microsoft
dm19898
Member
118 Points
24 Posts
Re: Clustered or WebFarm environment
Mar 21, 2013 09:14 PM|LINK
not sure what you mean by 'message bus' or how to change it.
we are a normal ASP.NET WebForm app that does run on a cluster and does indeed share a machine key.
I just placed a simple usage of SignalR for evaluation/test purposes and began seeing the following 2 types of error messages in our logs:
1) The state information is invalid for this page and might be corrupted.System.Web.UI.ViewStateException: Invalid viewstate.
2) The client disconnected.System.Web.UI.ViewStateException: Invalid viewstate.
Both errors are followed by the same system/stack info:
=====================================================================================
at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
at System.Type.GetType(String typeName, Boolean throwOnError)
at System.Web.UI.ObjectStateFormatter.DeserializeType(SerializerBinaryReader reader)
=====================================================================================
I should add that this application started life in ASPNET 1.0 and has been migrated to ASPNET 4.0 runtime.
Visual Studio solution explorer provides some hint of this as it sometimes only yields certain context menu items reminiscent of the original environment it was created in. I have learned to live with it.
davidfowl
Contributor
2699 Points
611 Posts
Microsoft
Re: Clustered or WebFarm environment
Mar 22, 2013 03:43 AM|LINK
Right, you can't use SignalR in a cluster of machines without knowing this or nothing will work.
This is the best information we have today on understanding why you need to make changes to your application:
http://stackoverflow.com/questions/13054592/how-does-signalr-redis-work-under-the-hood/13063449#13063449
I have no idea why you get corrupted viewstate or what that has to do with SignalR. Provide us with repro steps and file a bug on github and we can look into it.
Senior SDE, ASP.NET Team, Microsoft