SoftwareAG / cumulocity-lora

LoRa framework including implementations for TTN, Chirpstack, Kerlink Wanesy, Loriot, Actility, Objenious, Live Objects, Orbiwan as well as many codecs and still adding more, and lot of unique features such as user-friendly UI to send device commands, gateway management, codec IDE
Apache License 2.0
10 stars 2 forks source link

Avoid crashloop in case of invalid connector #112

Closed maciej-cz closed 1 week ago

maciej-cz commented 2 weeks ago

Problem

When Invalid connector is created (e.g. liveobjects connector with invalid API key) the system returns error, but the connector is created anyway. In such case a microservice keeps working normally. However, when the microservice is restarted and it fails to create a connection (in LNSIntegrationService::init) it enters crashloop: it keeps trying to create the invalid connection because of the way how cumulocity SDK reacts in exception from methods reacting on MicroserviceSubscriptionAddedEvent. The microservice is not operational in such case and when requested, cumulocity claims it's not subscribed by a tenant.

Solution

Errors at a single connector creation are logged and swallowed not affecting a whole microservice and other connectors.