telefonicaid / fiware-orion

Context Broker and CEF building block for context data management, providing NGSI interfaces.
https://github.com/telefonicaid/fiware-orion/blob/master/doc/manuals/orion-api.md
GNU Affero General Public License v3.0
210 stars 265 forks source link

orion exit function #607

Open kzangeli opened 10 years ago

kzangeli commented 10 years ago

orion is a daemon and should never die. Especially not on purpose. When compiled in debug mode we need it to be able to die gracefully to measure memory leaks using valgrind. Also, during unit tests we need to capture these exits and therefore we created a function to be called on exit, named orionExit (in contextBroker.cpp - there is another function in unitTest.cpp).

I just discovered that we call the orion exit function from a 'normal situation' - compoundValue.cpp. This call can occur in a broker compiled for production and this is not good. Instead of calling the orion exit function in compoundValue.cpp, we should try to return an error over REST.

Effort: 1 man day

fgalan commented 10 years ago

In which normal situation the function is called? I mean, which client request would produce invoking such function?

kzangeli commented 10 years ago

It is a 'crazy situation', one that should never happen. Like

x = 2;
if (x != 2)
  exit():

but much more complex of course. It's about compound values of attributes and it occurs if there was no 'previous' attribute (there must be a previous attribute, otherwise we wouldn't be treating the value of an attribute).