FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

make _request_timeout args work as expected; add default timeout by mike-eh2 · Pull Request #7 · dcbark01/PI-Web-API-Client-Python · GitHub

make _request_timeout args work as expected; add default timeout - #7

Open
mike-eh2 wants to merge 1 commit into
dcbark01:masterfrom
mike-eh2:request-timeouts
Open

make _request_timeout args work as expected; add default timeout#7
mike-eh2 wants to merge 1 commit into
dcbark01:masterfrom
mike-eh2:request-timeouts

Conversation

Copy link
Copy Markdown

My team was intermittently receiving alerts about the following error coming from requests through the PI web API client:

HTTPSConnectionPool(host='[redacted], port=443): Max retries exceeded with url: 
/piwebapi/attributes?path=[redacted] (Caused by ConnectTimeoutError(
urllib3.connection.HTTPSConnection object at 0x7fbf482d9a20, 
'Connection to [redacted] timed out. (connect timeout=None)'))

I saw that the client's API methods do accept _request_timeout arguments, but those arguments are not actually passed through to the request, so they don't do anything. This PR does two things:

  1. Fixes the implementation of the _request_timeout arg so that it works as intended
  2. Adds a default timeout. With no default in place, the timeout depends on the host system, which can cause issues when the application moves between platforms, as happened in my case.

We have been running this branch in production and our timeout issues are resolved.

Copy link
Copy Markdown
Author

@dcbark01 looks like this repo is unmaintained but I'm hoping you get a notification about this and consider approving it. Maintaining a public fork would be problematic for my team, but making our fork private would impose some technical challenges for our build pipeline, so getting this merged into the upstream would be ideal.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant


Back | FazBrowse Home | New Git URL