Application is getting disappeared from cepServer.Applications list
-
יום רביעי 29 פברואר 2012 07:19
using (Server cepServer = Server.Connect(endpointAddress)) { StartAppAndQueries(cepServer); Console.WriteLine("Startup completed."); Console.WriteLine("Enter D to delete the application"); if (Console.ReadLine() == "D") { DeleteApplication(cepServer); } }The above code is copied from: DevBiker.SimpleSIApp solution. After starting the application, wait for around 10 minutes and click "D" in console to delete the Application.
I am getting exception saying that key is not found. I debugged the code and found that: the
cepServer.Applications does not have any applications. I am surprised to see this.. my application is running.. so at least he collection should contain my application.
This happens only after some time, after starting the application. Any idea how the running application is getting removed from the cepServer.Applications collection? is there a bug in StreamInsight? (I am using 1.2 version)Venkat
כל התגובות
-
יום רביעי 29 פברואר 2012 15:19
I ran the same sample you are referring to but don't see the behaviour you are seeing.
What happens if you put breakpoints on all Dispose methods in the sample and set breakpoints on exceptions as well. I'd be interested to see if any of those get hit.
-
יום חמישי 01 מרץ 2012 05:12
Hi,
Keep it running for about 10 minutes (don't enter "D" button, before 10 minutes).
yes, when I debugged (i have put a breakpoint at: DeleteApplication(cepServer);) it showed that Applicaitons collections does not contain any applicaitons !!!
Yes, i have set breakpoints on exceptions as well.
In your case you kept it running for about 10 minutes and verified? And it is not consistant, so it is difficult to tell in what scenario this happens. I will let you know if I can find a pattern in reproducing this.. thanks.
Venkat
-
יום חמישי 01 מרץ 2012 06:37
Hi,
I got the erro now after 30 minutes of running the application. please see the images attached.
Exception details:
System.Collections.Generic.KeyNotFoundException was unhandled
Message=The given key was not present in the dictionary.
Source=Microsoft.ComplexEventProcessing.Diagnostics
StackTrace:
at Microsoft.ComplexEventProcessing.Diagnostics.Exceptions.Throw(Exception exception)
at Microsoft.ComplexEventProcessing.CepObjectReadOnlyDictionary`1.get_Item(String key)
at Microsoft.ComplexEventProcessing.CepObjectReadOnlyDictionary`1.System.Collections.Generic.IDictionary<System.String,T>.get_Item(String key)
at DevBiker.SimpleSIApp.Program.DeleteApplication(Server cepServer) in C:\...\StreamInsight\SimpleStreamInsightApp\C#\SimpleInProcOutOfProc\Program.cs:line 107
at DevBiker.SimpleSIApp.Program.Main(String[] args) in C:\..\StreamInsight\SimpleStreamInsightApp\C#\SimpleInProcOutOfProc\Program.cs:line 93
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Venkat
- נערך על-ידי VenkatABC יום חמישי 01 מרץ 2012 06:39
-
יום חמישי 01 מרץ 2012 11:23Yes, I ran it for 10 minutes previously. I'll run it for 30 minutes given this most recent result and let you know what happens here
-
יום חמישי 01 מרץ 2012 12:09I don't get your result. Just ran it for 45 minutes and it was still fine when I shutdown using the 'D' command
-
יום חמישי 01 מרץ 2012 17:16
Does this happen when you are running the embedded server or when you are running the remote server?
If remote, have you connected to the server from the query debugging just before you type "D"?
DevBiker (aka J Sawyer)
My Blog
My Bike - Concours 14
If I answered your question, please mark as answer.
If my post was helpful, please mark as helpful. -
יום ראשון 04 מרץ 2012 12:03
I am running this on Remote Server. I am NOT using the Embeded server.
"If remote, have you connected to the server from the query debugging just before you type "D"? " --> I did not stop the client to connect again. my cepServer object is still alive, and so I expect the SI meta data in it.
Venkat
-
יום ראשון 04 מרץ 2012 16:06
I understand what you expect - I was asking what additional steps for debugging that you have done.
Now, here's what's happening. First, you need to remember that StreamInsight is remote ... it's connecting via a WCF service. This WCF service is using sessions. After a period of inactivity, the session times out and you need to reconnect.
DevBiker (aka J Sawyer)
My Blog
My Bike - Concours 14
If I answered your question, please mark as answer.
If my post was helpful, please mark as helpful. -
יום שני 05 מרץ 2012 22:38
Some more information on the session timeout. Note that there is a timeout whether or not Reliable Sessions are used. From the WCF documentation:
When using a reliable session, there are two different inactivity timers that must be satisfied to keep the connection alive. If either of these inactivity timers goes off, then the connection is dropped.
-
The first inactivity timer is on the reliable session and is called the InactivityTimeout. This inactivity timer fires if no messages, either application or infrastructure, are received within the timeout period. An infrastructure message is a message that is generated for the purpose of one of the protocols in the channel stack, such as a keep alive or an acknowledgment, rather than containing application data.
-
The second inactivity timer is on the service and uses the ReceiveTimeout setting of the binding. This inactivity timer fires if no application messages are received within the timeout period. This specifies, for example, the maximum time a client may take to send at least one message to the server before the server will close the channel used by a session. This behavior ensures that clients cannot hold on to server resources for arbitrary long periods.
Since the connection is dropped if either inactivity timer fires, increasing InactivityTimeout once it is greater than ReceiveTimeout has no effect. The default for both of these timeouts is 10 minutes, so you always have to increase both of them to make a difference when using a reliable session.
If transaction flow is enabled on the binding or the channel, the operation may take longer to execute than the specified timeout. In these circumstances the operation fails due to the expired timeout and the transaction aborts appropriately.
DevBiker (aka J Sawyer)
My Blog
My Bike - Concours 14
If I answered your question, please mark as answer.
If my post was helpful, please mark as helpful. -
-
יום שלישי 06 מרץ 2012 08:59
DevBiker,
I see your point about WCF Session.
But I thought the SI client software knows to connect back to server when we try to access SI meta data.
Is there a way to know my SI client is connected to server or not? I don't see any Status property on the Server object.
Venkat
-
יום שלישי 06 מרץ 2012 15:14
Not that I can tell. The underlying WCF service is hidden pretty deep in the API and private. In a real-world app (as opposed to a simple demo app), I would suggest putting some sort of background timer in place to make a call across the wire to make sure that you don't time out. And error handling around it.
You could, however, always make a suggestion on Microsoft Connect. The product team does watch this closely and takes the submissions and feedback seriously.
DevBiker (aka J Sawyer)
My Blog
My Bike - Concours 14
If I answered your question, please mark as answer.
If my post was helpful, please mark as helpful.- נערך על-ידי DevBikerMVP יום שלישי 06 מרץ 2012 15:14
- סומן כתשובה על-ידי Stephanie LvModerator יום שני 19 מרץ 2012 07:45