[Freeipa-devel] [PATCH] Dogtag exception handling

Alexander Bokovoy abokovoy at redhat.com
Thu Mar 21 16:07:19 UTC 2013


Hi,

Martin asked me to update the patch I've attached to ticket
https://fedorahosted.org/freeipa/ticket/3492 and here we go.

Process exceptions when talking to Dogtag                                                                                                                                
                                                                                                                                                                                              
The problem is the ca_status() uses an HTTP GET operation to check
Dogtag's status. Under some circumstances Dogtag may take a long time to
respond, so the HTTP GET may time out much earlier than 2 minutes. And
since the above code doesn't catch the exception, the whole loop fails
immediately, so it doesn't wait for a full 2 minutes as expected.

-- 
/ Alexander Bokovoy
-------------- next part --------------
>From 15b60ee4f1dd39ccb406c3e35be086158eab782e Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy at redhat.com>
Date: Wed, 6 Mar 2013 10:17:58 +0200
Subject: [PATCH 2/2] Process exceptions when talking to Dogtag

The problem is the ca_status() uses an HTTP GET operation to check Dogtag's
status. Under some circumstances Dogtag may take a long time to respond, so the
HTTP GET may time out much earlier than 2 minutes. And since the above code
doesn't catch the exception, the whole loop fails immediately, so it doesn't
wait for a full 2 minutes as expected.

https://fedorahosted.org/freeipa/ticket/3492
---
 ipapython/platform/fedora16/service.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ipapython/platform/fedora16/service.py b/ipapython/platform/fedora16/service.py
index c2e35d3..dac8c00 100644
--- a/ipapython/platform/fedora16/service.py
+++ b/ipapython/platform/fedora16/service.py
@@ -136,7 +136,10 @@ class Fedora16CAService(Fedora16Service):
         timeout = api.env.startup_timeout
         op_timeout = time.time() + timeout
         while time.time() < op_timeout:
-            status = dogtag.ca_status()
+            try:
+                status = dogtag.ca_status()
+            except Exception:
+                status = 'check interrupted'
             root_logger.debug('The CA status is: %s' % status)
             if status == 'running':
                 break
-- 
1.8.1.4



More information about the Freeipa-devel mailing list