Bug 734214
Summary: | cpsetup tomcat timeout is too short (sometimes) | ||
---|---|---|---|
Product: | [Community] Candlepin | Reporter: | Jesus M. Rodriguez <jesusr> |
Component: | candlepin | Assignee: | Jesus M. Rodriguez <jesusr> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | John Sefler <jsefler> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 0.5 | CC: | bkearney, jmolet, lzap |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Solaris | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2012-05-29 19:04:56 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 715031 |
Description
Jesus M. Rodriguez
2011-08-29 18:38:38 UTC
1385 sub wait_for_tomcat { 1386 my $hostname = shift; 1387 1388 for (my $i = 0; $i < 20; $i++) { 1389 IO::Socket::INET->new( 1390 PeerAddr => 'localhost', 1391 PeerPort => '8009', 1392 Proto => 'tcp' 1393 ) or last; 1394 sleep 5; 1395 } 1396 1397 for (my $i = 0; $i < 20; $i++) { 1398 my $retval = system("HEAD http://$hostname/ 2>&1 > /dev/null"); 1399 if ($retval) { 1400 sleep 5; 1401 } 1402 else { 1403 return; 1404 } 1405 } 1406 print "Tomcat failed to start properly or the installer ran out of tries. Please check /var/log/tomcat*/catalina.out for errors.\n"; 1407 return; 1408 } Looks cool. Finally this problem gets solved ;-) Comment #1 needs to be ported to python and added to cpsetup. I don't think we can rely on HEAD system call which is provided by perl-libwww-perl, but we can simulate a HEAD call from within python: http://docs.python.org/library/httplib.html from the docs: >>> import httplib >>> conn = httplib.HTTPConnection("www.python.org") >>> conn.request("HEAD","/index.html") >>> res = conn.getresponse() Fixed in 9d38c154297e760839934fb8333b4e0a4a6a9af4 VERIFIED, candlepin-tomcat6-0.4.27-1.fc14.noarch candlepin-0.4.27-1.fc14.noarch Set up candlepin according to: https://fedorahosted.org/candlepin/wiki/Setup on a slow computer. running the cpsetup: [root@localhost ~]# /usr/share/candlepin/cpsetup Dropping candlepin database Creating candlepin database Loading candlepin schema Writing configuration file Creating CA private key password Creating CA private key Creating CA public key Creating CA certificate Waiting for tomcat to restart... Candlepin has been configured. The "waiting for tomcat restart" took about 20 seconds (longer than the old 5 second wait) and did not error out. |