gotthardp / lorawan-server

Compact server for private LoRaWAN networks
https://gotthardp.github.io/lorawan-server
MIT License
944 stars 327 forks source link

lorawan-server doesn't properly shutdown in docker container #843

Open lcse66 opened 9 months ago

lcse66 commented 9 months ago

Hi everyone.

The server running in the docker environment does not respond correctly to the shutdown request, but it is killed at the end of the timeout. A longer timeout produces no advantages. This behavior also causes side problems, including permanent errors in connectors when the connected service (e.g. mqtt broker) is running on the same server, and the server is being stopped. See also #771 #772. The issue can be verified by stopping the Lorawan container and measuring the shutdown time, which will be approximately 10 seconds (corresponding to the timeout for stopping the containers).

I know that this project is no longer being maintained for now, and I hope that it will be maintained again in the future. Best regards to @gotthardp for the excellent project.

hugosantosbessa commented 9 months ago

Hi @lcse66. I have the same error in the connectors when using an mqtt broker. When connecting the server it stops working. Did you make it work?

lcse66 commented 9 months ago

Hi Hugo (@hugosantosbessa) Sorry but I didn't understand the problem well. The mqtt connector works fine for me. The only problem is (was) that during the host shutdown the Lorawan server closes late, after the mqtt broker has stopped, and this causes a permanent error on the connector which requires manual reset (deleting the "badarg" flag by the connector configuration). With the change #844 that I proposed, the problem never recurred.