diff options
author | James E. Blair <jeblair@redhat.com> | 2017-07-11 09:52:58 -0700 |
---|---|---|
committer | James E. Blair <jeblair@redhat.com> | 2017-07-11 09:52:58 -0700 |
commit | 59424ea40f865077c91b8c56e04342702fc82888 (patch) | |
tree | 58ea5802e29e40c55117d0d96e9e92067c6f3f64 /zuul/scheduler.py | |
parent | 6b537764f3ab763296c1f4c34e5ebeab270cacef (diff) | |
download | zuul-59424ea40f865077c91b8c56e04342702fc82888.tar.gz |
Improve logging on reconfiguration
In order to perform a reconfiguration after a config-altering change
merges, we submit a management event to the queue which is handled
asynchronously. Unlike all other management events, this one has
no consumer waiting for it. For example, "zuul enqueue" operates
by way of management events, and it waits for a response and prints
that response for the operator. If an exception occurs, the exception
is printed. It is not, however, logged by the scheduler since it
was not considered interesting (the user was notified, after all).
Even global reconfiguration (where we send SIGHUP to the scheduler)
has the scheduler itself as the consumer and if an exception is raised,
it will record it.
However, since a single-tenant reconfiguration management event that
we drop in the queue has no consumer, if an exception occurs, it will
not be logged. Since we don't want to add a consumer to wait on the
event, add a logging exception handler for all management events. This
may mean we log global reconfiguration exceptions twice, but that's
preferable to the alternative of not logging tenant reconfiguration
exceptions at all.
Also, record the content fetched from cat jobs for static configuration.
We currently do so for dynamic reconfiguration, but not for static.
This is not scalable and we will likely need to remove this, and possibly
the dynamic log entry as well, in the future. However, in early days
when our configuration is small, it can be useful to verify exactly
what configuration we loaded.
Change-Id: Iacf95ae9812969da8f8de0f87beb8aa07940c4d2
Diffstat (limited to 'zuul/scheduler.py')
-rw-r--r-- | zuul/scheduler.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/zuul/scheduler.py b/zuul/scheduler.py index fe6a67393..dd0846da2 100644 --- a/zuul/scheduler.py +++ b/zuul/scheduler.py @@ -779,6 +779,7 @@ class Scheduler(threading.Thread): self.log.error("Unable to handle event %s" % event) event.done() except Exception: + self.log.exception("Exception in management event:") event.exception(sys.exc_info()) self.management_event_queue.task_done() |