Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Allow HTTP session timeout(s) tuning via config #2414

Closed
orgcontrib opened this issue Jun 9, 2023 · 5 comments · Fixed by #2425
Closed

Feature Request: Allow HTTP session timeout(s) tuning via config #2414

orgcontrib opened this issue Jun 9, 2023 · 5 comments · Fixed by #2425
Labels
Feature Request Feature Request | Enhancement Request Implemented
Milestone

Comments

@orgcontrib
Copy link

Is your feature request related to a problem? Please describe.

I know my VM is slow and it needs a lot more time (~20s) to complete certain tasks, especially network related ones. I'm frustrated about the HTTP session timeout(s) being hard-coded as 5 seconds. The suggested diagnostic using curl follows that well-known fact by using 5s values. I don't have a DNS resolver or network connectivity problem.

$ curl -I -m 30 https://graph.microsoft.com
HTTP/1.1 405 Method Not Allowed
Content-Length: 0
Strict-Transport-Security: max-age=31536000
request-id: 021c02ce-ace4-46e1-b59f-8535422064e5
client-request-id: 021c02ce-ace4-46e1-b59f-8535422064e5
x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"Germany West Central","Slice":"E","Ring":"5","ScaleUnit":"001","RoleInstance":"FR2PEPF000001E5"}}
Date: Fri, 09 Jun 2023 17:59:40 GMT

Describe the solution you'd like

I'd like to have both timeouts from util.d testNetwork() to be read from new Config file options that I can tune.
I envision this would be similar to:

$ onedrive --display-config |grep timeout
Config option 'operation_timeout'            = 3600

Describe alternatives you've considered

N/A - I couldn't find nor think of any alternative.
Yet, the UTO concept remains an important aspect.

Additional context

I hit the 5s timeout on my First connect (run) needed to get the oauth2 token.

@orgcontrib orgcontrib added the Feature Request Feature Request | Enhancement Request label Jun 9, 2023
@abraunegg
Copy link
Owner

abraunegg commented Jun 9, 2023

@orgcontrib
Unfortunately you are not going to like my initial answer here.

I am heavily in development of v2.5.x implementing #232 - thus, whilst making this change is trivial for v2.4.x, at the moment is a wasted effort for me.

The easiest path for you to take is to clone the source locally and make the applicable change to the code yourself.

However, with this being said, your feature request has already been factored in and catered for in the v2.5.x code base:

From util.d (v2.5.x)

image

That function pulls in the values from the application configuration

From config.d (v2.5.x)

These are the default values:
image

Which can be set via 'config' file options:
image

Application v2.5.0 evidence

Application Config:
image

Application Runtime Evidence:
image

Usage Evidence

[DEBUG] sync_dir: A '~' was found in configured sync_dir, automatically expanding as SHELL and USER environment variable is set
[DEBUG] Creating a backup of the applicable config file
[DEBUG] Updating applicable config file hash
[DEBUG] Updating sync_list hash
[DEBUG] Testing network to ensure network connectivity to Microsoft OneDrive Service
[DEBUG] Using Curl defaults for HTTP operations version (potentially HTTP/2)
[DEBUG] http.dnsTimeout = 1234
[DEBUG] http.connectTimeout = 5678
[DEBUG] http.dataTimeout = 600
[DEBUG] http.operationTimeout = 3600
[DEBUG] http.maxRedirects = 5
[DEBUG] Attempting to contact online service
* Rebuilt URL to: https://login.microsoftonline.com/
*   Trying 20.190.167.20...
* Connected to login.microsoftonline.com (20.190.167.20) port 443 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server did not agree to a protocol
* Server certificate:
*  subject: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; CN=stamp2.login.microsoftonline.com
*  start date: May 20 00:00:00 2023 GMT
*  expire date: May 20 23:59:59 2024 GMT
*  subjectAltName: host "login.microsoftonline.com" matched cert's "login.microsoftonline.com"
*  issuer: C=US; O=DigiCert Inc; CN=DigiCert SHA2 Secure Server CA
*  SSL certificate verify ok.
> HEAD / HTTP/1.1
Host: login.microsoftonline.com
User-Agent: ISV|abraunegg|OneDrive Client for Linux/v2.5.0-dev
Accept: */*

< HTTP/1.1 200 OK

So your next question will be - when can you get v2.5.x ? Please refer to: #2387 & #2415

@abraunegg abraunegg added this to the v2.5.0 milestone Jun 9, 2023
@abraunegg abraunegg added the In Progress Currently being worked on label Jun 9, 2023
@orgcontrib
Copy link
Author

@abraunegg Replying with a working prototype artifact in such a short time already exceeded my expectation. Kudos to you. I will be patient and wait for v2.5.0.

@abraunegg
Copy link
Owner

@orgcontrib

@abraunegg Replying with a working prototype artifact in such a short time already exceeded my expectation. Kudos to you. I will be patient and wait for v2.5.0.

Due to #2423 I will be now doing an urgent v2.4.24 release. What I will do is add capability this into v2.4.24 so that this is available sooner rather than later.

@abraunegg abraunegg modified the milestones: v2.5.0, v2.4.24 Jun 19, 2023
abraunegg added a commit that referenced this issue Jun 19, 2023
* Implement #2414 to allow HTTP session timeout(s) tuning via config (taken from v2.5.x)
@abraunegg abraunegg added Implemented and removed In Progress Currently being worked on labels Jun 19, 2023
@abraunegg
Copy link
Owner

@orgcontrib
As this Feature Request will close post 'merging' - the following are applicable new configuration items post this PR merge:

# dns_timeout = "60"
# connect_timeout = "10"
# data_timeout = "600"
# ip_protocol_version = "0"
  • 'dns_timeout' controls the libcurl dns_cache_timeout timeout, value in seconds
  • 'connect_timeout' controls the connect timeout for HTTP|HTTPS connections
  • 'data_timeout' controls the activity timeout on a connection
  • 'ip_protocol_version' controls what IP protocol version should be used when communicating with OneDrive. 0 = IPv4 + IPv6, 1 = IPv4 Only, 2 = IPv6 Only

abraunegg added a commit that referenced this issue Jun 19, 2023
…2425)

* Implement #2414 to allow HTTP session timeout(s) tuning via config (taken from v2.5.x)
@abraunegg
Copy link
Owner

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Repository owner locked as resolved and limited conversation to collaborators Jun 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Request Feature Request | Enhancement Request Implemented
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants