Skip to content

Commit

Permalink
Increase dbus client timeouts during CA install
Browse files Browse the repository at this point in the history
When running on memory-constrained systems, the `ipa-server-install`
program often fails during the "Configuring certificate server
(pki-tomcatd)" stage in FreeIPA 4.5 and 4.6.

The memory-intensive dogtag service causes swapping on low-memory
systems right after start-up, and especially new certificate
operations requested via certmonger can exceed the dbus client default
25 second timeout.

This patch changes dbus client timeouts for some such operations to
120 seconds (from the default 25 seconds, IIRC).

See more discussion in FreeIPA PR freeipa#1078 [1] and FreeIPA container
issue freeipa#157 [2].  Upstream ticket at [3].

[1]: freeipa#1078
[2]: freeipa/freeipa-container#157
[3]: https://pagure.io/freeipa/issue/7213

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
  • Loading branch information
zultron authored and stanislavlevin committed Dec 25, 2017
1 parent e17172e commit cfee0e9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions freeipa/ipalib/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@
IPA_CA_NICKNAME = 'caSigningCert cert-pki-ca'
RENEWAL_CA_NAME = 'dogtag-ipa-ca-renew-agent'
RENEWAL_REUSE_CA_NAME = 'dogtag-ipa-ca-renew-agent-reuse'
# How long dbus clients should wait for CA certificate RPCs [seconds]
CA_DBUS_TIMEOUT = 120

# regexp definitions
PATTERN_GROUPUSER_NAME = '^[a-zA-Z0-9_.][a-zA-Z0-9_.-]*[a-zA-Z0-9_.$-]?$'
Expand Down
5 changes: 4 additions & 1 deletion freeipa/ipalib/install/certmonger.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import subprocess
import tempfile
from ipalib import api
from ipalib.constants import CA_DBUS_TIMEOUT
from ipapython.dn import DN
from ipaplatform.paths import paths
from ipaplatform import services
Expand Down Expand Up @@ -620,7 +621,9 @@ def modify_ca_helper(ca_name, helper):
old_helper = ca_iface.Get('org.fedorahosted.certmonger.ca',
'external-helper')
ca_iface.Set('org.fedorahosted.certmonger.ca',
'external-helper', helper)
'external-helper', helper,
# Give dogtag extra time to generate cert
timeout=CA_DBUS_TIMEOUT)
return old_helper


Expand Down
5 changes: 4 additions & 1 deletion freeipa/ipaserver/install/dogtaginstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

from ipalib import api, errors, x509
from ipalib.install import certmonger
from ipalib.constants import CA_DBUS_TIMEOUT
from ipaplatform import services
from ipaplatform.constants import constants
from ipaplatform.paths import paths
Expand Down Expand Up @@ -262,7 +263,9 @@ def configure_certmonger_renewal(self):
iface.add_known_ca(
name,
command,
dbus.Array([], dbus.Signature('s')))
dbus.Array([], dbus.Signature('s')),
# Give dogtag extra time to generate cert
timeout=CA_DBUS_TIMEOUT)

def __get_pin(self):
try:
Expand Down

0 comments on commit cfee0e9

Please sign in to comment.