singer-io / tap-adwords

GNU Affero General Public License v3.0
29 stars 37 forks source link

v1.13.1: Monkeypatch urllib's open() to open a socket with a timeout specified #85

Closed dmosorast closed 3 years ago

dmosorast commented 3 years ago

Description of change

The googleads SDK client does pass a timeout of 60 minutes to the requests it makes directly through zeep, but through testing, it turns out that the ReportDownloader that we use to stream responses opens a raw socket without passing a timeout.

This is suspiciously near the potential cause of an intermittent zombie job when the server's connection snaps, but the tap's connection does not, which is something that the requests library documents for its usage with urllib.

Since this call is not configurable as seen in the below link, this PR monkeypatches urllib so that it gets a default timeout of 300 seconds on the socket that is opened.

Googleads usage of open: https://github.com/googleads/googleads-python-lib/blob/17.0.0/googleads/adwords.py#L1690

Manual QA steps

Risks

Rollback steps