[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 14:13:48 EST 2012


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

Andre Dietisheim commented on JBIDE-10676:
------------------------------------------

built a new client jar and added it to our client bundle. committed to TRUNK (Beta1)
                
> 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