- Oct 22, 2010
-
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Iustin Pop authored
Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Oct 20, 2010
-
-
Michael Hanselmann authored
This basically extracts a small piece of code from ganeti-rapi and puts it into a utility function. RAPI resources are found using a dictionary in which the keys can either be static strings or compiled regular expressions. This might be handy in other places, hence extracting it and adding unittests. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
- Oct 13, 2010
-
-
Michael Hanselmann authored
The base class can contain code useful to other inotify users. As it is “SingleFileEventHandler” can not be used in ganeti-rapi, therefore it'll use its own small inotify handler class based on this base class. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Reading the file before this function allows for better error reporting. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Oct 12, 2010
-
-
Michael Hanselmann authored
If a job was cancelled while it was waiting for locks, an assertion would've failed. This patch fixes the problem and provides a unit test to check for this situation. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Oct 07, 2010
-
-
Iustin Pop authored
This patch merges the pid file handling used for ganeti-* daemons and impexp daemons. The latter version is used, since it's more reliable: uses locked pid files as opposed to checking 'live' processes. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Oct 05, 2010
-
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
This function will also be used in tools/move-instance. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Sep 30, 2010
-
-
Iustin Pop authored
Currently, the computation of the 'pure' name or the variant is hardcoded and spread around the functions that need it. This is not nice, and in the future we'd spread it even more with more usage of variants/pure os names. This patch abstracts these functions into the OS class, and then replaces the hardcoded uses with the new functions. Signed-off-by:
Iustin Pop <iustin@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Sep 29, 2010
-
-
Guido Trotter authored
Signed-off-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Sep 24, 2010
-
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Michael Hanselmann authored
As already noted in the design document, an opcode's priority is increased when the lock(s) can't be acquired within a certain amount of time, except at the highest priority, where in such a case a blocking acquire is used. A unittest is provided. Priorities are not yet used for acquiring the lock(s)—this will need further changes on mcpu. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
- Sep 23, 2010
-
-
Michael Hanselmann authored
The changes to job queue processing require some changes on this class' interface. LockAttemptTimeoutStrategy might move to another place, but that'll be done in a later patch. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
René Nussbaumer <rn@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Sep 22, 2010
-
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Sep 20, 2010
-
-
Michael Hanselmann authored
In order to support priorities, the processing of jobs needs to be changed. Instead of processing jobs as a whole, the code is changed to process one opcode at a time and then return to the queue. See the Ganeti 2.3 design document for details. This patch does not yet use priorities for acquiring locks. The enclosed unittests increase the test coverage of jqueue.py from about 34% to 58%. Please note that they also test some parts not added by this patch, but testing them became only possible with some infrastructure added by this patch. For the first time, many implications and assumptions for the job queue are codified in these unittests. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Sep 16, 2010
-
-
Michael Hanselmann authored
By enabling all log levels, we ensure all calls are fully evaluated. There was one case in the workerpool where a call to “logging.debug” was wrong, but not caught in unittests because debug logging was disabled. The optional environment variable “LOGTOSTDERR” can be set to write all log messages to stderr instead of /dev/null. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Sep 13, 2010
-
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
This allows clients to submit opcodes with a priority. Except for being tracked by the job queue, it is not yet used by any code. Unittests for jqueue._QueuedOpCode and jqueue._QueuedJob are provided for the first time. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Sep 07, 2010
-
-
Michael Hanselmann authored
For proper support of job priorities, jobs' locks need to respect priorities. Otherwise it could happen that a job with a lower priority could get a lock before a job with a higher priority (depending on timeouts and when they start acquiring). This patch adds support for priorities in SharedLock and LockSet and provides (unfortunately non-trivial) unittests. Outdated comments are also adjusted and improved. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
René Nussbaumer authored
Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Michael Hanselmann authored
Comes with unittest. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Sep 06, 2010
-
-
René Nussbaumer authored
This is used to expand the users/group names just once at initial call. Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
- Aug 27, 2010
-
-
Michael Hanselmann authored
This is accomplished by keeping a list of waiting threads instead of just their number inside the lock-internal condition. A few other tweaks to the output format are also made. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Aug 25, 2010
-
-
René Nussbaumer authored
And provide unittests for them Signed-off-by:
René Nussbaumer <rn@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Aug 24, 2010
-
-
Michael Hanselmann authored
To add job priorities, the worker pool underlying the job queue must support priorities per task. This patch adds them to the worker pool. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
While writing unittests for the new lock monitor, I made a small mistake and didn't synchronize acquiring locks properly. This patch takes care of this issue by adding additional synchronization. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
This patch adds an initial implementation of a lock monitor, accessible for the user through “gnt-debug locks”. It currently shows all resource locks: BGL, nodes and instances. Config and job queue locks could be shown too, but wouldn't be of much help. The current owner(s) and mode are also shown. Showing pending acquires will require further changes on the SharedLock internals and is not yet implemented. Example output: $ gnt-debug locks -o name,mode,owner Name Mode Owner BGL/BGL shared JobQueue19/Job147 instances/inst1 exclusive JobQueue19/Job147 instances/inst2 - - instances/inst3 - - instances/inst4 - - nodes/node1 exclusive JobQueue19/Job147 nodes/node2 exclusive JobQueue19/Job147 Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
With this patch, the task name is added to the thread name and will show up in logs. Log messages from jobs will look like “pid=578/JobQueue14/Job13 mcpu:289 DEBUG LU locks acquired/cluster/BGL/shared”. Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-
- Aug 23, 2010
-
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Manuel Franceschini authored
By doing this we delegate the task of finding the correct address family to the FormatAddress method. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Aug 19, 2010
-
-
Manuel Franceschini authored
Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
- Aug 18, 2010
-
-
Manuel Franceschini authored
Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Michael Hanselmann authored
Signed-off-by:
Michael Hanselmann <hansmi@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Manuel Franceschini authored
This patch moves the FormatAddress helper function from daemon.py to netutils.py. This enables its use in http.client as well as in rapi.client. Furthermore this adds functionality to format IPv6 addresses according to RFC 3986. It is required for use of literal IPv6 addresses in URLs in pycurl. For some reason it worked also without the bracketing ("["<address>"]"), but we do not want to rely on that. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
-
Manuel Franceschini authored
This patch enables IPv6 name resolution by using socket.getaddrinfo instead of socket.gethostbyname_ex. It renames the HostInfo class to Hostname and unifies its use throughout the code. This is achieved by using static calls where no object is needed and removes some obsolete code. For now, we just resolve to IPv4 addresses, but this will change once it is needed. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Iustin Pop <iustin@google.com>
-
Manuel Franceschini authored
In light of the upcoming IPv6 support, this patch enables the rpc.Client to always use a node's address to connect to it. This is necessary as we do not want to rely on name resolution to connect to the correct IP address on a dual-stack machine. Signed-off-by:
Manuel Franceschini <livewire@google.com> Reviewed-by:
Guido Trotter <ultrotter@google.com>
-