When using an external repo hosted on a particularly flaky server which sometimes takes a very long time to respond, the default yum timeout of 30 seconds can be too short.
This adds a kojid config item for controlling the yum timeout. --- builder/kojid | 3 ++- builder/kojid.conf | 3 +++ koji/__init__.py | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/builder/kojid b/builder/kojid index 4ea93f2..af8a15b 100755 --- a/builder/kojid +++ b/builder/kojid @@ -229,7 +229,7 @@ class BuildRoot(object): for k in ('repoid', 'tag_name'): if hasattr(self, k): opts[k] = getattr(self, k) - for k in ('mockdir', 'topdir', 'topurl', 'topurls', 'packager', 'vendor', 'distribution', 'mockhost', 'yum_proxy', 'rpmbuild_timeout'): + for k in ('mockdir', 'topdir', 'topurl', 'topurls', 'packager', 'vendor', 'distribution', 'mockhost', 'yum_proxy', 'yum_timeout', 'rpmbuild_timeout'): if hasattr(self.options, k): opts[k] = getattr(self.options, k) opts['buildroot_id'] = self.id @@ -4499,6 +4499,7 @@ def get_options(): 'allowed_scms': '', 'support_rpm_source_layout': True, 'yum_proxy': None, + 'yum_timeout': None, 'maven_repo_ignore': '*.md5 *.sha1 maven-metadata*.xml _maven.repositories ' 'resolver-status.properties *.lastUpdated', 'failed_buildroot_lifetime' : 3600 * 4, diff --git a/builder/kojid.conf b/builder/kojid.conf index 5f0aaec..8796a78 100644 --- a/builder/kojid.conf +++ b/builder/kojid.conf @@ -35,6 +35,9 @@ ; Timeout for build duration (24 hours) ; rpmbuild_timeout=86400
+; Timeout for yum downloading packages in mock (30 seconds) +; yum_timeout=30 + ; The URL for the xmlrpc server server=http://hub.example.com/kojihub
diff --git a/koji/__init__.py b/koji/__init__.py index 612bfd5..c405178 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -1314,6 +1314,9 @@ def genMockConfig(name, arch, managed=False, repoid=None, tag_name=None, **opts) # HTTP proxy for yum if opts.get('yum_proxy'): yc_parts.append("proxy=%s\n" % opts['yum_proxy']) + # fetch timeout for yum + if opts.get('yum_timeout'): + yc_parts.append('timeout=%s\n' % opts['yum_timeout']) # Rest of the yum options yc_parts.append("""\ cachedir=/var/cache/yum
On Monday, September 21, 2015 09:09:53 AM Dan Callaghan wrote:
When using an external repo hosted on a particularly flaky server which sometimes takes a very long time to respond, the default yum timeout of 30 seconds can be too short.
This adds a kojid config item for controlling the yum timeout.
builder/kojid | 3 ++- builder/kojid.conf | 3 +++ koji/__init__.py | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/builder/kojid b/builder/kojid index 4ea93f2..af8a15b 100755 --- a/builder/kojid +++ b/builder/kojid @@ -229,7 +229,7 @@ class BuildRoot(object): for k in ('repoid', 'tag_name'): if hasattr(self, k): opts[k] = getattr(self, k)
for k in ('mockdir', 'topdir', 'topurl', 'topurls', 'packager',
'vendor', 'distribution', 'mockhost', 'yum_proxy', 'rpmbuild_timeout'): + for k in ('mockdir', 'topdir', 'topurl', 'topurls', 'packager', 'vendor', 'distribution', 'mockhost', 'yum_proxy', 'yum_timeout', 'rpmbuild_timeout'): if hasattr(self.options, k): opts[k] = getattr(self.options, k) opts['buildroot_id'] = self.id @@ -4499,6 +4499,7 @@ def get_options(): 'allowed_scms': '', 'support_rpm_source_layout': True, 'yum_proxy': None,
'yum_timeout': None, 'maven_repo_ignore': '*.md5 *.sha1 maven-metadata*.xml
_maven.repositories ' 'resolver-status.properties *.lastUpdated', 'failed_buildroot_lifetime' : 3600 * 4, diff --git a/builder/kojid.conf b/builder/kojid.conf index 5f0aaec..8796a78 100644 --- a/builder/kojid.conf +++ b/builder/kojid.conf @@ -35,6 +35,9 @@ ; Timeout for build duration (24 hours) ; rpmbuild_timeout=86400
+; Timeout for yum downloading packages in mock (30 seconds) +; yum_timeout=30
; The URL for the xmlrpc server server=http://hub.example.com/kojihub
diff --git a/koji/__init__.py b/koji/__init__.py index 612bfd5..c405178 100644 --- a/koji/__init__.py +++ b/koji/__init__.py @@ -1314,6 +1314,9 @@ def genMockConfig(name, arch, managed=False, repoid=None, tag_name=None, **opts) # HTTP proxy for yum if opts.get('yum_proxy'): yc_parts.append("proxy=%s\n" % opts['yum_proxy'])
- # fetch timeout for yum
- if opts.get('yum_timeout'):
# Rest of the yum options yc_parts.append("""\yc_parts.append('timeout=%s\n' % opts['yum_timeout'])
cachedir=/var/cache/yum
technically I see nothing wrong with the patch, however I would suggest that you make a local mirror for slow repos. but that is a implementation detail. and it may not be possible to do so ACK
Dennis
Excerpts from Dennis Gilmore's message of 2015-09-25 11:11 -05:00:
technically I see nothing wrong with the patch, however I would suggest that you make a local mirror for slow repos. but that is a implementation detail. and it may not be possible to do so ACK
Sadly, the slow mirror in our case *is* a local mirror. :-) It's just using some slow, old, overloaded NFS storage and it only occasionally has problems (takes a few minutes to serve a request) so we have to just put up with it.
koji-devel@lists.fedorahosted.org