Uploaded image for project: 'OpenShift Java Client'
  1. OpenShift Java Client
  2. OSJC-70

OpenShift java client assumes that the app is available when it gets 404

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.1
    • None
    • None
    • None

      The java client currently assumes that the app has become available as soon as it gets accessible by its DNS-name.

      OpenShiftService#waitForApplication:

      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
      	}
      }
      

      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):

                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
      

              adietish@redhat.com André Dietisheim
              adietish@redhat.com André Dietisheim
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: