[jbosstools-issues] [JBoss JIRA] (JBIDE-10676) OpenShift java client assumes that the app is available when it gets 404

Andre Dietisheim (JIRA) jira-events at lists.jboss.org
Wed Jan 25 10:37:04 EST 2012


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

Andre Dietisheim edited comment on JBIDE-10676 at 1/25/12 10:36 AM:
--------------------------------------------------------------------

I work around the abovementioned limitation by only waiting if a health url is present in IApplication. This should pretty much work since the application only has a health check url when its being created and therefore may not be ready yet. If an IApplication is created from application infos (you query the list of your existing applications -> the applications are created from application infos - which you get from user info) you have no health check url available. But since you are looking at an application that was created far earlier, it for sure is accessible. 
                
      was (Author: adietish):
    I work around the abovementioned limitation by not waiting if no health url is present in IApplication. This should pretty much work since the application only has a health check url when its being created and therefore may not be ready yet. If an IApplication is created from application infos (you query the list of your existing applications -> the applications are created from application infos - which you get from user info) you have no health check url available. But since you are looking at an application that was created far earlier, it for sure is accessible. 
                  
> OpenShift java client assumes that the app is available when it gets 404
> ------------------------------------------------------------------------
>
>                 Key: JBIDE-10676
>                 URL: https://issues.jboss.org/browse/JBIDE-10676
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: openshift
>    Affects Versions: 3.3.0.M5
>            Reporter: Andre Dietisheim
>            Assignee: Andre Dietisheim
>             Fix For: 3.3.0.Beta1
>
>
> The java client currently assumes that the app has become available as soon as it gets accessible by its DNS-name.
> OpenShiftService#waitForApplication:
> {code}
> while (response == null
> 		&& System.currentTimeMillis() < startTime + timeout) {
> 	try {
> 		Thread.sleep(APPLICATION_WAIT_DELAY);
> 		response = client.get();
> 	} catch (InternalServerErrorException e) {
> 		return true;
> 	} catch (BadRequestException e) {
> 		return true;
> 	} catch (NotFoundException e) {
> 		return true;
> 	} catch (HttpClientException e) {
> 		// not available yet
> 	}
> }
> {code}
> Talking to the guys on libra I found out that it's not. The rhc-tools also consider the response code (https://github.com/openshift/os-client-tools/blob/master/express/lib/rhc-common.rb#L606):
> {code}
>           begin
>             response = net_http.get_response(url)
>           rescue Exception => e
>             response = nil
>           end
>           if !response.nil? && response.code == "200" && response.body[0,1] == "1"
>             puts CLEAR_LINE + "Confirming application '#{app_name}' is available:  Success!"
>             puts ""
>             puts "#{app_name} published:  http://#{fqdn}/"
>             puts "git url:  #{git_url}"
>             if @mydebug
>               unless no_git
>                 puts "To make changes to '#{app_name}', commit to #{repo_dir}/."
>               else
>                 puts <<LOOKSGOOD
> To make changes to '#{app_name}', you must first clone it with:
>       git clone #{git_url}
> LOOKSGOOD
>                 puts "Then run 'git push' to update your OpenShift Express space."
>               end
>             end
>             if result && !result.empty?
>               puts "#{result}"
>             end
>             return true
>           end
>           if !response.nil? && @mydebug
>             puts "Server responded with #{response.code}"
>             puts response.body unless response.code == '503'
>           end
>           puts "    sleeping #{sleep_time} seconds" if @mydebug
>           sleep sleep_time
>           sleep_time = delay(sleep_time)
>       end
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list