timeout missing for request call causing gts2_client to go freeze
I discovered a sporadic issue that appears to be occurring on the following line:
Sometimes the gts2_client gets stuck on this line. The last time this happened was yesterday night. I got the following last logs:
# gts2_client Requesting data from the GTS2 server ... # gts2_client >>>>>> API-call: https://rz-vm175.gfz-potsdam.de:443/AC/B05_B06_B07_B8A_B11_B12/20180531_20190530/13.71773_13.72423_52.39845_52.40020?minimum_fill=0.0&sensor=S2all&level=L2A&version=0.13&suffix=coreg&max_cloudy=1.0&utm_zone=
I ran the same commands again and they started working again, so this issue is not easily reproducible.
My suggested fix: Add a timeout check to the requests calls like:
result = requests.get(self.api_call, timeout=100, verify=False, auth=opts["auth"]["auth"]) # timeout after 100 seconds
The harder part is to decide: How many seconds to wait? Do you have any experience / logs on what the maximum time is that one request is allowed to take?