DPIclimate / broker

3 stars 3 forks source link

Make Ubidots delivery service restart in docker-compose, find a way to fix the root cause #15

Open dajtxx opened 1 year ago

dajtxx commented 1 year ago

The Ubidots delivery service does not restart when it crashes due to the restart setting in docker-compose.yml. It has crashed twice over the summer holiday season and had to be restarted manually. Change the restart setting.

However, fixing the crash would be better!

It seems to happen when requests get hung up waiting for Ubidots during a data POST. 10 minutes and 4 minutes were the timings in the two crashes. In the first case it was a 504, in the second a 500.

It seems RabbitMQ closes the channel and connection (due to inactivity?) during this period, so when the delivery code tried to nack the message during the exception handling it received another exception, did not catch it, and the process exited.

Some means of detecting and reopening the RabbitMQ connection seems to be necessary, or a way of spinning the Ubidots POST off into the background so the RabbitMQ keep-alives can keep going.