Search code examples
fiwarecomplex-event-processingfiware-cep

Fiware CEP server stops responding


In developing in Fi-Cloud's CEP I've been having an issue that has been happening repeatedly. As I'm trying to develop a definition to perform a task, CEP's server and Authoring Tool stop responding, although ssh is still responsive.

This issue happens as I develop. I'm using the AuthoringTool to alter the definition bit by bit and then I re-upload it to the server through the authoring tool's export feature. To reinitiate the proton with the new definition each time I alter it, I use Google's Postman with this single operation:

-PUT (url:http://{ip}:8080/ProtonOnWebServerAdmin/resources/instances/ProtonOnWebServer) header: 'Content-Type' : 'application/json'; body : {"action": "ChangeDefinitions","definitions-url" : "/ProtonOnWebServerAdmin/resources/definitions/Definition_Name"}

At the same time, I'm logged in with three ssh intances, one to monitor the files being created on /opt/tomcat10/sample/ and other things, and the other two to 'tail -f ' log files the definition writes to, as events are processed: one log for events recieved and another log for events detected by the EPAgent.

I'm iterating through these procedures over and over as I'm developing and eventualy CEP server and the Authoring Tool stop responding.

By "tailing" tomcat's log file (# tail -f /opt/tomcat10/logs/catalina.out) I can see that, when under these circumstances, if I attemp a:

-GET (url: http://{ip}:8080/ProtonOnWebServerAdmin/resources/instances/ProtonOnWebServer) I get no response back and tomcat logs the following response:

11452100 [http-bio-8080-exec-167] ERROR org.apache.wink.server.internal.RequestProcessor - An unhandled exception occurred which will be propagated to the container.
java.lang.OutOfMemoryError: PermGen space
Exception in thread "http-bio-8080-exec-167" java.lang.OutOfMemoryError: PermGen space

Ssh is still responsive and I can look at tomcat's log this way. To get over this and continue, I exit ssh connections and restart CEP's instance in the Fi-Cloud.

Is the procedure I'm using to re-upload and re-run the definition inapropriate? Should I take a different approach to developing?


Solution

  • When you update a definition that the CEP is already working with, and you want the CEP engine to work with the updated definition, you need to:

    1. Export the definition using the authoring tool export (as you did)

    2. Stop the engine run, using REST PUT

      PUT //host:8080/ProtonOnWebServerAdmin/resources/instances/ProtonOnWebServer
      {"action":"ChangeState","state":"stop"}
      
    3. Start the engine, using REST PUT

      PUT //host:8080/ProtonOnWebServerAdmin/resources/instances/ProtonOnWebServer
      {"action":"ChangeState","state":"start"}
      

    You don't need to activate the "ChangeDefinitions" action, since it is the same definition name that the engine is already working with.

    Activating "ChangeDefinitions" action, only influences the next run of the CEP, and has no influence on the current run.

    This answer your question about how you should update a CEP definition. Hope it will solve your issue.