faucetsdn / faucetagent

gNMI agent for faucet configuration
4 stars 2 forks source link

Make HUP optional for reloading #22

Closed cglewis closed 5 years ago

cglewis commented 5 years ago

Reload currently performs a HUP every time a configuration is set, it would be nice to have an option to not do that if Faucet is using the environment variable FAUCET_CONFIG_STAT_RELOAD=1 which automatically reloads the config whenever it detects the config has changed.

cglewis commented 5 years ago

Also, it looks like it's actually Prometheus that is being HUP'd and not Faucet, is that intended? I didn't think that would actually apply changes made to the config?

https://github.com/faucetsdn/faucetagent/blob/master/faucetagent.py#L184

cmd = 'fuser -k -HUP %d/tcp' % self.prometheus_port
lantz commented 5 years ago
  1. That is doable.
  2. Yes, that is intended – it uses that port to scrape prometheus vars and also signals the listener, which is presumably FAUCET. Are you using some sort of prometheus aggregator or multiplexer so that it is not actually FAUCET that is listening at that port? If so, what would be a more reliable way of identifying FAUCET given that its PID and command line might change, etc.?
cglewis commented 5 years ago

Oh, re 2 - forgot it wasn't pointing to the aggregator (on 9090), so that makes sense, nevermind.