Bug 1314240 - RFE: add a timeout value for oc rsh
Summary: RFE: add a timeout value for oc rsh
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: RFE
Version: 3.1.0
Hardware: All
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: Juan Vallejo
QA Contact: Xingxing Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-03-03 09:24 UTC by Christophe Augello
Modified: 2023-09-14 03:18 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-17 16:09:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Christophe Augello 2016-03-03 09:24:09 UTC
3. What is the nature and description of the request?

> possibility to add a timeout value for oc rsh
 
4. Why does the customer need this? (List the business requirements here)
 
> When oc rsh , the connection gets lost after approx 60 ~ 120 secs.
This is inconvenient while looking for information for that pod and when coming back to shell connection is lost.

5. How would the customer like to achieve this? (List the functional requirements here)
 
6. For each functional requirement listed in question 5, specify how Red Hat
and the customer can test to confirm the requirement is successfully implemented.

> when setting a timeout option of 600 , the connection will only be lost after 600 secs.
 
7. Is there already an existing RFE upstream or in Red Hat bugzilla?
> N/A
 
8. Does the customer have any specific timeline dependencies?

> N/a
 
9. Is the sales team involved in this request and do they have any additional input?

> N/a
 
10. List any affected packages or components.

> oc cli
 
11. Would the customer be able to assist in testing this functionality if implemented?
> Yes

Comment 1 Fabiano Franz 2016-12-02 21:17:12 UTC
3.4 now has a --timeout option.

Comment 2 Xingxing Xia 2016-12-12 09:57:21 UTC
Tested on version:
$ oc version
oc v3.4.0.34+87d9d8d
kubernetes v1.4.0+776c994
features: Basic-Auth GSSAPI Kerberos SPNEGO

Server https://openshift-...com:8443
openshift v3.4.0.34+87d9d8d
kubernetes v1.4.0+776c994

For `oc rsh --timeout=<time> database-1-3dmoq`, tried time=10, 300, 600. When the terminal is idle for longer than <time> seconds and we come back to the terminal, oc rsh still keeps alive, i.e. does not exit.

Comment 3 Xingxing Xia 2016-12-12 10:41:44 UTC
About the help info:
$ oc rsh -h
...
      --timeout=10: Request timeout for obtaining a pod from the server ...
...

$ oc options
...
      --request-timeout='0': The length of time to wait before giving up on a single server request
...

Above info both hint 'R/request' timeout. IMHO, from intuitive textual reading, I didn't figure out what is the diff of 'timeout' flag in oc rsh from the global 'timeout' flag --request-timeout. Until I read comment 0 scenario, I got the former is about the idle time for oc rsh session.

So it is better to update help info of --timeout for oc rsh clearer

Comment 4 Juan Vallejo 2016-12-12 20:24:41 UTC
Related origin PR: https://github.com/openshift/origin/pull/12231
Related kubernetes PR: https://github.com/kubernetes/kubernetes/pull/38642

Comment 5 Juan Vallejo 2016-12-13 16:06:03 UTC
Related upstream PR: https://github.com/kubernetes/kubernetes/pull/38642

Comment 6 Juan Vallejo 2016-12-14 21:42:51 UTC
Right now the current default idle timeout for commands such as `oc rsh` and `oc exec` is 4 hours [1]. This can be changed as part of the cluster config by a cluster admin.

I am not sure why your connection was timing out after 1-2 mins, but I recommend updating oc and seeing if you are still having this issue.

[1] https://github.com/openshift/origin/blob/master/vendor/k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1/defaults.go#L303

Comment 7 Juan Vallejo 2016-12-15 18:01:54 UTC
Closing related pull requests for now.
https://github.com/kubernetes/kubernetes/pull/38642
https://github.com/openshift/origin/pull/12231

> 4. Why does the customer need this? (List the business requirements here)
>
>> When oc rsh , the connection gets lost after approx 60 ~ 120 secs.
> This is inconvenient while looking for information for that pod and when coming 
> back to shell connection is lost.

This bug is most likely an issue not directly addressed by the addition of a client-side option to update idle timeouts for streams. 
Please also see https://bugzilla.redhat.com/show_bug.cgi?id=1314240#c6

Comment 8 Juan Vallejo 2017-01-17 16:09:59 UTC
Closing this as not a bug for now. Please re-open if problem still exists after updating `oc`

Comment 9 Red Hat Bugzilla 2023-09-14 03:18:54 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.