----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/52105/#review149824 -----------------------------------------------------------
Hi, @drcrallen Thanks a lot for your patch! I saw your patch try to redirect `http://SOME_MASTER:5050/master/redirect/master/frameworks` to `http://LEADER_MASTER:5050/master/frameworks`. Could you elaborate the user cases about this? Because we have handled the endpoint redirection automatically internal. For example, when you request `http://NON_LEADING_MASTER:5050/master/frameworks`, mesos master would redirect to `http://LEADING_MASTER:5050/master/frameworks`. - haosdent huang On Sept. 21, 2016, 3:03 a.m., Charles Allen wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/52105/ > ----------------------------------------------------------- > > (Updated Sept. 21, 2016, 3:03 a.m.) > > > Review request for mesos and Vinod Kone. > > > Bugs: MESOS-6210 > https://issues.apache.org/jira/browse/MESOS-6210 > > > Repository: mesos > > > Description > ------- > > Add smarter master redirects. > > > Diffs > ----- > > docs/endpoints/master/redirect.md 3387b64c32fe394949863cbcb3e2b58be1b00bd0 > src/master/http.cpp 9005e7c308d5f57c6f5c573951d468a3ba730740 > > Diff: https://reviews.apache.org/r/52105/diff/ > > > Testing > ------- > > Single Node started with `./src/mesos-master --work_dir=/tmp/mesos` > > > ``` > Charless-MacBook-Pro:~ charlesallen$ curl -v http://127.0.0.1:5050/redirect > * Trying 127.0.0.1... > * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0) > > GET /redirect HTTP/1.1 > > Host: 127.0.0.1:5050 > > User-Agent: curl/7.43.0 > > Accept: */* > > > < HTTP/1.1 307 Temporary Redirect > < Date: Tue, 20 Sep 2016 23:12:24 GMT > < Location: //10.17.97.185:5050 > < Content-Length: 0 > < > * Connection #0 to host 127.0.0.1 left intact > Charless-MacBook-Pro:~ charlesallen$ curl -v > http://127.0.0.1:5050/redirect/foo > * Trying 127.0.0.1... > * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0) > > GET /redirect/foo HTTP/1.1 > > Host: 127.0.0.1:5050 > > User-Agent: curl/7.43.0 > > Accept: */* > > > < HTTP/1.1 307 Temporary Redirect > < Date: Tue, 20 Sep 2016 23:12:35 GMT > < Location: //10.17.97.185:5050/foo > < Content-Length: 0 > < > * Connection #0 to host 127.0.0.1 left intact > Charless-MacBook-Pro:~ charlesallen$ curl -v > http://127.0.0.1:5050/master/redirect/test > * Trying 127.0.0.1... > * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0) > > GET /master/redirect/test HTTP/1.1 > > Host: 127.0.0.1:5050 > > User-Agent: curl/7.43.0 > > Accept: */* > > > < HTTP/1.1 307 Temporary Redirect > < Date: Tue, 20 Sep 2016 23:12:49 GMT > < Location: //10.17.97.185:5050/test > < Content-Length: 0 > < > * Connection #0 to host 127.0.0.1 left intact > Charless-MacBook-Pro:~ charlesallen$ curl -v > http://127.0.0.1:5050/master/redirectNOTFOUND/test > * Trying 127.0.0.1... > * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0) > > GET /master/redirectNOTFOUND/test HTTP/1.1 > > Host: 127.0.0.1:5050 > > User-Agent: curl/7.43.0 > > Accept: */* > > > < HTTP/1.1 404 Not Found > < Date: Tue, 20 Sep 2016 23:12:57 GMT > < Content-Length: 0 > < > * Connection #0 to host 127.0.0.1 left intact > Charless-MacBook-Pro:~ charlesallen$ curl -v > http://127.0.0.1:5050/master/redirect/ > * Trying 127.0.0.1... > * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0) > > GET /master/redirect/ HTTP/1.1 > > Host: 127.0.0.1:5050 > > User-Agent: curl/7.43.0 > > Accept: */* > > > < HTTP/1.1 404 Not Found > < Date: Tue, 20 Sep 2016 23:13:32 GMT > < Content-Length: 0 > < > * Connection #0 to host 127.0.0.1 left intact > Charless-MacBook-Pro:~ charlesallen$ curl -v > http://127.0.0.1:5050/master/redirect/test > * Trying 127.0.0.1... > * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0) > > GET /master/redirect/test HTTP/1.1 > > Host: 127.0.0.1:5050 > > User-Agent: curl/7.43.0 > > Accept: */* > > > < HTTP/1.1 307 Temporary Redirect > < Date: Tue, 20 Sep 2016 23:13:43 GMT > < Location: //10.17.97.185:5050/test > < Content-Length: 0 > < > * Connection #0 to host 127.0.0.1 left intact > ``` > > It is worth noting that in this PR /master/redirect/ and /redirect/ return > 404, not 307. This behavior is consistent with master. > > > Thanks, > > Charles Allen > >