History | View | Annotate | Download (11.7 kB)
ganeti-confd: remove partial imports
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
ConfdAsyncUDPServer: handle signals at read time
Currently if a signal is delivered during an attempted read, anexception is logged in the logfile. There is no need for this, so wehandle this case explicitely.
Signed-off-by: Guido Trotter <ultrotter@google.com>...
ConfdAsyncUDPServer: defer handling writes
Currently if we fail writing to the socket (perhaps because a signal wasdelivered) we lose the data we were sending. Although this is not toobad (it's udp, and data may get lost anyway) we try to avoid this by...
Abstract AsyncUDPSocket to daemon
This allows this extended asyncore+udp module to be used also in otherdaemons, and in the confd client library
ConfdAsyncUDPServer: fix a docstring
It refers to an older input variable
Add a magic fourcc code to confd packets
This will make it easier to change the protocol later on
ganeti-confd: explicitely log failed big sends
Make sure that if we try to send packages which are too big (whichshouldn't happen) this gets properly logged in the config file.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
Move fourcc packing/unpacking to main confd module
This way it can be used by the client as well
Wrap lines over 80 characters
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Luca Bigliardi <shammash@google.com>
confd: avoid spamming the logfile
When confd is disabled we don't want to be noticed every timer interval.
Move SimpleConfigReader creation to ConfdProcessor
This will be useful to make ConfdProcessor aware of a config failure,without quitting confd.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
ConfdProcessor: add disabled state
This is a state the processor will get in, if it fails to load theconfig.
confd: start in polling mode
This allows us not to enable the inotify handler immediately, and thusto make it easier for us should the config file not exist at all.
Confd: don't fail if the config doesn't load
Rather than quitting we'll just continue to poll the config at a slowrate, hoping that sooner or later we'll get it back. This allows alsoworking on non-MC nodes, and smoothly transitioning from MC to non-MC,...
confd: s/confd_event_handler/inotify_handler/
In a case we don't encounter frequently (file modified but notoverwritten) the notify handler we use is called with a wrong name.
Implement timers in confd
Timers are used both for checking for inotify failures, and for polling,should inotify notices become too frequent.
ConfdInotifyEventHandler.enable: use InotifyError
Rather than raising ConfdFatalError directlyConfdInotifyEventHandler.enable raises InotifyError should it not beable to configure inotify, allowing the caller to decide what to do.
ConfdInotifyEventHandler, move to a callback
ConfdInotifyEventHandler used to reload the config whenever anotification arrived. Moving to a callback system, so thatConfdConfigurationReloader can be responsible for that functionality.
Additionally the inotify class no longer reenables itself automatically,...
Move creation of inotify handler to a new class
This class will be responsible for managing inotify notifications,timers, and rate-limiting reloads. For now none of these features isimplemented. :)
ConfdInotifyEventHandler: add enable/disable
Make possible to enable and disable the inotify event handler. Theinotify handler will remain enabled, unless explicitely told to disableitself.
Style fixes for ganeti-*
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Convert ganeti-confd to Mainloop
Now that mainloop is asyncore-enabled we can easily do that.
Remove unused imports from confd files
confd.server and daemons/ganeti-confd import a few modules they don'tactually use. Clean them up.
Initial confd implementation
ganeti-confd is a simple asynchronous daemon, which listens on a UDPport, passes each packet to a processor, and sends back to the clientthe result.
It also listens on an inotify socket, in order to reload itsconfiguration when the ganeti config file changes....