History | View | Annotate | Download (14.3 kB)
luxi: disable two lint errors
This is already disabled for the same type of request a couple of linesabove. The new code was introduced in e986f20c but didn't have thedisables.
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Michael Hanselmann <hansmi@google.com>
Add support and checks for version in LUXI
A new constant, LUXI_VERSION, is used to verify the peer's version. Theversion is optional, so old(er) clients and servers talking to peers notsupporting it won't break. Example with mismatching library:
$ gnt-instance list...
luxi.ProtocolError: Derive from errors.LuxiError
This allows LUXI errors to be encoded and serialized.
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Add simple lock monitor
This patch adds an initial implementation of a lock monitor, accessiblefor the user through “gnt-debug locks”. It currently shows all resourcelocks: BGL, nodes and instances. Config and job queue locks could beshown too, but wouldn't be of much help. The current owner(s) and mode...
luxi: convert permission errors into exception
This patch adds handling of permission errors so that we don't showtracebacks when a non-root user runs a gnt-* command. Since in thefuture we'll have different permissions, we need to handle this in RAPItoo....
Merge branch 'devel-2.1'
Conflicts: lib/luxi.py - trivial
Signed-off-by: Guido Trotter <ultrotter@google.com>Reviewed-by: Iustin Pop <iustin@google.com>
Abstract the LUXI eom into a constant
Currently the EOM terminator is hardcoded on the server side, and iscustomizable in the Transport object (with the default being the same asthe value found in the server), but not in the luxi client.
With this patch we move the value to constants, and remove the "fake"...
RAPI: Allow waiting for job changes
Merge remote branch 'origin/devel-2.1'
Handle EAGAIN in LUXI client
If too many clients try to connect to the master at the same time, some ofthem might fail if the master doesn't accept the connections fast enough.
Show message when job is waiting in queue or for locks
Jobs submitted via the standard command line utilities didn't give anyindication that anything is happening while they were waiting in the jobqueue (e.g. due to other jobs using all worker threads) or acquiring...
Factorize LUXI parsing and handling code
Also fix a typo in http/__init__.py and add unittestsfor the LUXI parsing and formatting functions.
Simplify LUXI exceptions
Having only one exception hierarchy makes catching them simpler. BeforeProtocolError would derive directly from Exception, but with this patchit'll also be in the hierarchy defined by the ganeti.errors module.Separating encoding and decoding errors is not necessary at this point...
Introduce a Luxi call for GetTags
This changes from submitting jobs to get the tags (in cli scripts) toqueries, which (since the tags query is a cheap one) should be muchfaster.
The tags queries are already done without locks (in the generic querypaths for instances/nodes/cluster), so this shouldn't break tags query...
Add targeted pylint disables
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>
luxi: Pass socket path directly to exception, not in tuple
Signed-off-by: Michael Hanselmann <hansmi@google.com>Reviewed-by: Guido Trotter <ultrotter@google.com>
Move the luxi error handling into errors.py
Currently the luxi error handling is hardcoded as special encoding onthe masterd-side and special decoding on the client side. This patchmoves it to errors.py such that other parts of the code can reuse thesame encoding....
Add file to pause watcher for a certain duration
This can be used during maintenance work.
Merge branch 'next' into branch-2.1
Fix pylint warnings
Fix problem with EAGAIN on socket connection in clients
If a user used ^Z to stop the program, poll() in socket.recv would returnEAGAIN due to SIGSTOP. This patch changes luxi.Transport.Recv to ignore EAGAIN.
Signed-off-by: Michael Hanselmann <hansmi@google.com>...
Fix some typos
Add a luxi call for multi-job submit
As a workaround for the job submit timeouts that we have, this patchadds a new luxi call for multi-job submit; the advantage is that all thejobs are added in the queue and only after the workers can startprocessing them....
Add one new luxi query: cluster info
This is the last query that RAPI executes via opcodes and is purelystatic (config values only). As such, we can convert it safely to aquery instead of job.
Reviewed-by: imsnah
Implement lockless query operations
This patch adds the framework for, and enables lockless OpQueryInstances. Thismeans that instances will be shown in ERROR_up or ERROR_down state, even thoughthis is not an error (but just an in-progress job).
The framework is implemented as follows:...
luxi: close and reopen the socket on errors
This is less of an actual issue for regular gnt-* clients, but it'seasily reproducible with burnin and possible with RAPI (depending on howthe program uses luxi.Client(s)).
In case of burnin, if we interrupt the client (^C) while it polls the...
Fix a typo in luxi's docstring
Reviewed-by: iustinp
Prevent RPC timeout on auto-archiving jobs
With a large job queue, auto-archiving jobs can take a very long time,causing timeouts on the luxi RPC layer. With this change, auto-archive returns after half of the RPC timeout has passed. The userwill see how many jobs are left unchecked....
Add an interface for the drain flag changes/query
This adds the set/reset in the jqueue and luxi modules, and a way toquery it in OpQueryConfigValues, and also the comand line interface forit:$ gnt-cluster queue infoThe drain flag is unset$ gnt-cluster queue drain...
Implement transport of ganeti errors across luxi
This patch adds a generic method to identify the ganeti error given itsclass name, and implements this across the luxi protocol.
Implement job auto-archiving
This patch adds a new luxi call that implements auto-archiving of jobsolder than a certain age (or -1 for all completed jobs), and the gnt-jobcommand that makes use of this (with 'all' for -1).
Add new query to get cluster config values
This can be used to retrieve certain cluster config values fromwithin clients.
OpDumpClusterConfig was not used anywhere, hence I'm just reusingit. The way ConfigWriter.DumpConfig returned the configurationwas not thread-safe, anyway (no deepcopy)....
Make WaitForJobChanges deal with long jobs
This patch alters the WaitForJobChanges luxi-RPC call to have aconfigurable timeout, so that the call behaves nicely with long jobsthat have no update.
We do this by adding a timeout parameter in the RPC call, and returning...
Fix error message when masterd is not listening
Reported by Iustin.
Make sure that client programs get all messages
This is a large patch, but I can't figure out how to split it withoutbreaking stuff. The old way of getting messages by always getting thelast one didn't bring all messages to the client if they were added...
Add RPC call to wait for job changes
This way clients can react faster to status or message changes anddon't have to poll anymore.
Reviewed-by: ultrotter
Add query function for exports
Implement query for nodes
Implement query for instances
Queries don't create jobs and are more efficient. Log messagesare not yet stored anywhere.
Fix pylint-detected issues
This is mostly: - whitespace fix (space at EOL in some files, not all, broken indentation, etc) - variable names overriding others (one is a real bug in there) - too-long-lines - cleanup of most unused imports (not all)...
Remove old job queue code
Change masterd/client RPC protocol
- Introduce abstraction class on client side- Use constants for method names- Adopt legacy function SubmitOpCode to use it
Make luxi RPC more flexible
- Use constants for dict entries- Handle exceptions on server side- Rename client function to CallMethod to match server side naming
luxi: Use serializer module instead of simplejson
Implement handling of luxi errors in cli.py
Currently the generic handling of ganeti errors in cli.py (GenericMainand FormatError) only handles the core ganeti errors, and not the clientprotocol errors (which live in a separate hierarchy).
This patch adds handling of luxi errors too, and also adds another luxi...
Change client protocol to raise exception on failures
Currently the luxi.client.SubmitJob and Query methods return the unserializedresult without processing it at all. This patch changes this by adding a'RequestException' error that is raised if the query itself or the...
Move some checks from cli.py to luxi.py
The idea of cli.py and luxi.py is that all protocol checks should be inluxi, and cli.py should just offer some helpful shortcuts for thecommand line scripts.
This patch removes the result checks from cli and adds some other checks...
Add submit function to lib/cli.py
This patch adds function that submit jobs or queries over the unix socketinterface to lib/cli.py. The will be used by the scripts instead of theSubmitOpCode function.
Initial implementation of the client unix socket
This patch adds an initial implementation of the client-side of the unixsocket interface. The code is not yet used by other parts of ganeti.