diff --git a/utils.py b/utils.py index 502bba8c..0d0301e2 100644 --- a/utils.py +++ b/utils.py @@ -158,6 +158,11 @@ def __init__(self, url, auth, verify): self.curl.setopt(pycurl.CONNECTTIMEOUT, 10) self.curl.setopt(pycurl.WRITEDATA, self.received_buffer) + # Marathon >= 1.7.x returns 30x responses for /v2/events responses + # when they're coming from a non-leader. So we follow redirects. + self.curl.setopt(pycurl.FOLLOWLOCATION, True) + self.curl.setopt(pycurl.MAXREDIRS, 1) + # The below settings are to prevent the connection from hanging if the # connection breaks silently. Since marathon-lb only listens, silent # connection failure results in marathon-lb waiting infinitely.