openwisp / openwisp-config

OpenWRT configuration agent for OpenWISP Controller
https://openwisp.io/docs/dev/openwrt-config-agent/
GNU General Public License v3.0
372 stars 56 forks source link

[change] Stop sending checksum requests on 404 #160

Closed nemesifier closed 2 years ago

nemesifier commented 2 years ago

If a device gets deleted from the server but stays turned on will keep sending HTTP requests unnecessarily to the server, which is undesirable.

We should deal with this.

I think that if a 404 is detected, we could either stop the agent (exit with a non zero exit code) right away or let it try a few times before giving up.

nemesifier commented 2 years ago

@okraits @feckert any thoughts on this?

Kevinjil commented 2 years ago

This could create issues in orchestrated environments where services can return a 404 in some situations, such as https://github.com/traefik/traefik/issues/1689.

nemesifier commented 2 years ago

This could create issues in orchestrated environments where services can return a 404 in some situations, such as traefik/traefik#1689.

@Kevinjil thanks for your input.

That sounds like a bug in Traefik, since it would be better to return something different than 404 in those cases.

However we have to keep those temporary issues in mind, here's what I think we can do: