- Apr 07, 2010
-
-
Iustin Pop authored
Commit dfdc4060 added WaitForFdCondition which uses utils.Retry without handling timeout exceptions. This breaks any nested retry loops. This patch fixes the above function, and also changes utils.Retry to detect and warn future similar cases. In addition, we add a few small unittests for utils.Retry. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Mar 18, 2010
-
-
Guido Trotter authored
This function allows receiving socket data synchronously. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
This basically implements read handling, without catching all exceptions. When using the socket in synchronous mode, it's useful to avoid losing exception data (which, in an async daemon, can only be logged) Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Jan 28, 2010
-
-
Iustin Pop authored
This patch adds a configure-time parameter that will set the defaults used by all programs, and command-line parameters in the daemons that allow overriding it. Syslog 'yes' enables syslog in addition to file-based logging, 'only' enables syslog and disables file-based syslog. The log entries will be of the form: Jan 27 08:45:04 node2 ganeti-noded[14504]: INFO 172.24.227.5:50850 PUT /jobqueue_update HTTP/1.0 200 Jan 27 08:45:05 node2 ganeti-noded[14505]: INFO 172.24.227.5:50853 PUT /lv_list HTTP/1.0 200 and (for a multi-threaded program): Jan 27 08:51:48 node1 ganeti-masterd[15491]: (MainThread) INFO ganeti-masterd daemon startup Jan 27 08:51:49 node1 ganeti-masterd[15491]: (MainThread) INFO Inspecting job queue Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Jan 04, 2010
-
-
Iustin Pop authored
This patch should have only: - pylint disables - docstring changes - whitespace changes Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Olivier Tharan <olive@google.com>
-
- Nov 03, 2009
-
-
Iustin Pop authored
A newer version of pylint, more warnings… Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Oct 12, 2009
-
-
Michael Hanselmann authored
Found using pylint and epydoc. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Sep 24, 2009
-
-
Iustin Pop authored
It does “print >> sys.stderr, …” but there is no import sys. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Sep 16, 2009
-
-
Guido Trotter authored
Currently we read maximum 4K packets, and don't check packets when sending them. With this patch we move to a well defined maximum size of 60K. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Guido Trotter authored
This allows this extended asyncore+udp module to be used also in other daemons, and in the confd client library Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 21, 2009
-
-
Guido Trotter authored
This time we use the standard python sched module, rather than doing it all by ourselves. The scheduler in mainloop can be manipulated directly by callers, to enter new events. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 20, 2009
-
-
Guido Trotter authored
We can avoid most of the Mainloop.Run() code if we use asyncore for delivering I/O events, and just concentrate on what's missing in asyncore: singnal handling and timers. This way confd can be ported to use Mainloop as well. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Mainloop currently calls all handlers with the signal number harcoded to sigchild. Fixing this. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Olivier Tharan <olive@google.com>
-
Guido Trotter authored
This makes the function a lot simpler, since it used to install two different signal handlers, which are now transparently handled by the decorator. The code is unindented, but remains unchanged apart from the part that checks the signal handlers (which is now collapsed toghether). The option of not installing signal handlers, which was unused, is now removed. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
IO is never unregistered in our current usage, so dropping that functionality for now. Also putting the poller outside of the Run() function allows us to avoid the double step of adding tuples to an _io_wait_add queue and adding them later in the main loop. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Guido Trotter authored
Timers are currently unused, slightly buggy (for example timeout doesn't get updated correctly), and unneeded in the current form. Confd will have timeouts in more simple fashion, and is not a mainloop user anyway. Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Jul 26, 2009
-
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com>
-
- Jul 25, 2009
-
-
Guido Trotter authored
With three ganeti daemons, and one or two more coming, the daemon's main function started becoming too much cut&pasted code. Collapsing most of it in a daemon.GenericMain function. Some more code could be collapsed between the two http-based daemons, but since the new daemons won't be http-based we won't do it right now. As a bonus a functionality for overriding the network port on the command line for all network based nodes is added. Signed-off-by:
Guido Trotter <ultrotter@google.com>
-
- Mar 20, 2009
-
-
Guido Trotter authored
set timeout_needs_update to False after calculating the timeout. Reviewed-by: imsnah
-
- Nov 11, 2008
-
-
Michael Hanselmann authored
This is a fallout from my work on the HTTP client class. Repeating timers are prepared, but not yet implemented. Reviewed-by: iustinp
-
- Nov 10, 2008
-
-
Michael Hanselmann authored
While working on the HTTP client class, I wanted to use Mainloop before deciding to use threads instead. - Add docstrings - Rename "quit" to "running", move it to a local variable - Support adding and removing I/O listeners while running (e.g. to add/remove listeners from OnIO(…) calls) - Allow user of the class to disable signal handlers - Flag to exit once all listeners are gone Reviewed-by: iustinp
-
- Oct 23, 2008
-
-
Michael Hanselmann authored
We don't have timers yet, hence waking up is not needed at all. Reviewed-by: ultrotter
-
- Oct 17, 2008
-
-
Guido Trotter authored
This fixes removals of the pid files and clean exit in the init script Reviewed-by: iustinp
-
Guido Trotter authored
There is no point in initializing sigchld_handler as an empty dict, when it will be overwritten by an instance of utils.SignalHandler immediately after. Reviewed-by: iustinp
-
- Oct 10, 2008
-
-
Michael Hanselmann authored
This mainloop can be used in daemons like ganeti-noded. Reviewed-by: iustinp
-