[jbosstools-issues] [JBoss JIRA] (JBIDE-13569) Error when waiting for application to become reachable

Andre Dietisheim (JIRA) jira-events at lists.jboss.org
Wed Feb 20 05:59:56 EST 2013


    [ https://issues.jboss.org/browse/JBIDE-13569?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12755345#comment-12755345 ] 

Andre Dietisheim edited comment on JBIDE-13569 at 2/20/13 5:58 AM:
-------------------------------------------------------------------

In JBIDE-10676 the health check was corrected to consider the application "not ready yet" if something else than status code "200" (404 for instance) was returned. 
The difference to the current waiting code is that the code back then was not throwing errors, it kept waiting:

{code}
try {
	IHttpClient client = createHttpClient(id, healthCheckUrl, false);
	String response = null;
	long startTime = System.currentTimeMillis();
	while (!HEALTH_RESPONSE_OK.equals(response)
		&& System.currentTimeMillis() < startTime + timeout) {
		try {
			Thread.sleep(APPLICATION_WAIT_DELAY);
			response = client.get();
		} catch (HttpClientException e) {
			// not available yet
		}
	}
	return HEALTH_RESPONSE_OK.equals(response);
} catch (InterruptedException e) {
	return false;
} catch (MalformedURLException e) {
	throw new OpenShiftException(e, MALFORMED_URL_EXCEPTION_MSG, healthCheckUrl);
}

In commit https://github.com/bdecoste/openshift-java-client/commit/b1f1f63589d704b9a15517611b3c5b6dffb348a9#L0L419 the code was changed on purpose and stopped waiting in case of a response that differs from "200".
{code}
                
      was (Author: adietish):
    In JBIDE-10676 the health check was corrected to consider the application "not ready yet" if something else than status code "200" (404 for instance) was returned. 
The difference to the current waiting code is that the code back then was not throwing errors, it kept waiting:

{code}
try {
	IHttpClient client = createHttpClient(id, healthCheckUrl, false);
	String response = null;
	long startTime = System.currentTimeMillis();
	while (!HEALTH_RESPONSE_OK.equals(response)
		&& System.currentTimeMillis() < startTime + timeout) {
		try {
			Thread.sleep(APPLICATION_WAIT_DELAY);
			response = client.get();
		} catch (HttpClientException e) {
			// not available yet
		}
	}
	return HEALTH_RESPONSE_OK.equals(response);
} catch (InterruptedException e) {
	return false;
} catch (MalformedURLException e) {
	throw new OpenShiftException(e, MALFORMED_URL_EXCEPTION_MSG, healthCheckUrl);
}
{code}
                  
> Error when waiting for application to become reachable
> ------------------------------------------------------
>
>                 Key: JBIDE-13569
>                 URL: https://issues.jboss.org/browse/JBIDE-13569
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: openshift
>    Affects Versions: 4.1.0.Alpha1
>            Reporter: Stefan Bunciak
>            Assignee: Andre Dietisheim
>             Fix For: 4.1.0.Alpha2
>
>         Attachments: error-waiting-for-reachable.png, JBT_0219.png
>
>
> {code}
> com.openshift.client.NotFoundOpenShiftException: Could not find any OpenShift resource at "http://testapp-1360837500661.rhcloud.com/health"
> 	at com.openshift.internal.client.RestService.request(RestService.java:101)
> 	at com.openshift.internal.client.ApplicationResource.waitForPositiveHealthResponse(ApplicationResource.java:510)
> 	at com.openshift.internal.client.ApplicationResource.waitForAccessible(ApplicationResource.java:487)
> 	at org.jboss.tools.openshift.express.internal.ui.job.WaitForApplicationJob.doRun(WaitForApplicationJob.java:50)
> 	at org.jboss.tools.openshift.express.internal.ui.job.AbstractDelegatingMonitorJob.run(AbstractDelegatingMonitorJob.java:35)
> 	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
> Caused by: com.openshift.internal.client.httpclient.NotFoundException: Could not find resource "http://testapp-1360837500661.rhcloud.com/health"
> 	at com.openshift.internal.client.httpclient.UrlConnectionHttpClient.get(UrlConnectionHttpClient.java:96)
> 	at com.openshift.internal.client.RestService.request(RestService.java:139)
> 	at com.openshift.internal.client.RestService.request(RestService.java:97)
> 	... 5 more
> Caused by: java.io.FileNotFoundException: http://testapp-1360837500661.rhcloud.com/health
> 	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1434)
> 	at com.openshift.internal.client.httpclient.UrlConnectionHttpClient.get(UrlConnectionHttpClient.java:94)
> 	... 7 more
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jbosstools-issues mailing list