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 should end when it is not able to connect to DB at startup #3695

Closed fgalan closed 3 years ago

fgalan commented 4 years ago

Currently, when Orion is not able to connect to DB at startup this is shown in logs:

time=Friday 11 Sep 09:18:09 2020.901Z | lvl=ERROR | corr=N/A | trans=N/A | from=N/A | srv=N/A | subsrv=N/A | comp=Orion | op=mongoConnectionPool.cpp[180]:mongoConnect | msg=Database Startup Error (cannot connect to mongo - doing 100 retries with a 1000 millisecond interval)

which is fine but, in addition, Orion shoul stop working. It is pointless to have running a process that is not able of doing any operations (in fact, the listening port of the Orion API is not working in this situation). Better to stop, so monitoring tools (like monit, etc.) can detect the situation and alarm properly.

In fact, ERROR -> FATAL in the log trace

kzangeli commented 4 years ago

I thought it actually exited, after a number of retries ...

If not, then I'd propose to let it try at least 3 times before giving up

fgalan commented 4 years ago

I think the retry times are fine (100 >> 3 :)). Is the action when the retrial fails which needs to be changed.

fgalan commented 3 years ago

It is actually implemented, see https://github.com/telefonicaid/fiware-orion/pull/3806#issuecomment-817585683.

Missing entry added to CNR in PR https://github.com/telefonicaid/fiware-orion/pull/3833