Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1358393

Summary: rfe: add a global timeout option to oc
Product: OpenShift Container Platform Reporter: Sten Turpin <sten>
Component: RFEAssignee: Juan Vallejo <jvallejo>
Status: CLOSED ERRATA QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.2.1CC: aos-bugs, jokerman, jvallejo, misalunk, mmccomas, tdawson, yapei
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-18 12:51:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Sten Turpin 2016-07-20 15:24:55 UTC
Description of problem: during the outage to the preview-prod cluster caused by https://bugzilla.redhat.com/show_bug.cgi?id=1351705 our monitoring checks, which call the oc command, got hung up for several days because oc didn't time out. 


Version-Release number of selected component (if applicable): oc v3.2.1.7


How reproducible: in cases when k8s is extremely slow, e.g. due to https://bugzilla.redhat.com/show_bug.cgi?id=1351705


Steps to Reproduce:
1. in a cluster with k8s in bad state, run "oc get projects" 

Actual results:
In some cases, this command ran for 5 days before we noticed it and killed the process. 


Expected results:
oc should time out eventually if the API is not available


Additional info:

Comment 1 Dan McPherson 2016-08-18 15:02:08 UTC
*** Bug 1368131 has been marked as a duplicate of this bug. ***

Comment 2 Juan Vallejo 2016-10-03 20:28:17 UTC
Related PR: https://github.com/openshift/origin/pull/11104

Comment 3 Xingxing Xia 2016-10-25 06:49:13 UTC
Verified with oc v3.4.0.14. Now user can use the global option --request-timeout with any oc command:
$ oc get projects --request-timeout=1h
NAME        DISPLAY NAME   STATUS
xxia-proj                  Active

Test the result when it timeouts:
$ oc get projects --request-timeout=1ms
Unable to connect to the server: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

Fixed. Move to VERIFIED.

Comment 5 errata-xmlrpc 2017-01-18 12:51:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0066