ITRS-Group / monitor-merlin

Module for Effortless Redundancy and Loadbalancing In Naemon
https://itrs-group.github.io/monitor-merlin/
GNU General Public License v2.0
22 stars 14 forks source link

Fresh mon commands #118

Closed erikdsjostrom closed 3 years ago

erikdsjostrom commented 3 years ago

Changes needed for slim-poller refactor.

jacobbaungard commented 3 years ago

de-registering should probably be under a lock too right? I.e. if multiple pollers de-register at the same time.

erikdsjostrom commented 3 years ago

de-registering should probably be under a lock too right? I.e. if multiple pollers de-register at the same time.

Yes, the only reason it's not under a lock is that I forgot to add it.

erikdsjostrom commented 3 years ago

Rebased and added locking for deregistering.

jacobbaungard commented 3 years ago

Aren't we still missing something like fcntl.flock(file_descriptor, fcntl.LOCK_EX | fcntl.LOCK_NB) when de-registering?

jacobbaungard commented 3 years ago

the new script is missing in Makefile.am, so it's not included in the builds.

erikdsjostrom commented 3 years ago

Correct again, the heat is getting to me.

jacobbaungard commented 3 years ago

For registering I think it's fine that we don't retry getting the lock. However for de-registering that doesn't work as the container will just exit/be deleted without having de-registered. auto_delete will take care of removing the dead node eventually, but that is not ideal.

erikdsjostrom commented 3 years ago

For registering I think it's fine that we don't retry getting the lock. However for de-registering that doesn't work as the container will just exit/be deleted without having de-registered. auto_delete will take care of removing the dead node eventually, but that is not ideal.

I agree, that would be an issue. But I think it's best to handle that on the slim-poller side, I'll start brewing a new commit.