Skip to content
This repository has been archived by the owner on Dec 4, 2024. It is now read-only.

Commit

Permalink
Follow redirects from non-leaders in Marathon 1.7 (#595)
Browse files Browse the repository at this point in the history
Marathon 1.7.x returns a 302 redirect response from a non-leader. So we make sure Marathon-lb can follow it to the leader.

Related Marathon JIRA card: https://jira.mesosphere.com/projects/MARATHON/issues/MARATHON-7178

Fixes #594
  • Loading branch information
paambaati authored and Tim Harper committed Aug 3, 2018
1 parent 72a7570 commit 797b158
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 797b158

Please sign in to comment.