> On Sept. 21, 2016, 3:18 p.m., haosdent huang wrote: > > 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`. > > Charles Allen wrote: > That comes from two things: > > 1. > http://mesos.apache.org/documentation/latest/endpoints/master/redirect/ > suggests using redirect as a UI bookmarking mechanism, as such, it seemed > reasonable for other calls to be able to redirect through the same mechanism. > This might be a left-over suggestion from pre-1.0 though. An alternative > thing here would be to update the redirect docs to remove the suggestion for > UI bookmarking if it is no longer required. > 2. That's how some other internal discovery mechanism are setup here, so > I kind of expected http://SOME_MASTER:5050/master/redirect/state to redirect > to the master and get the cluster state. But if the non-leading masters > should redirect to the leading masters then I don't think that is helpful > anymore, and I think that behavior changed with 1.0? > > haosdent huang wrote: > Hi, @drcrallen > > >1. ... suggests using redirect as a UI bookmarking mechanism > > I think you may misunderstand this. We suggest to bookmark > `http://SOME_MASTER:5050/master/redirect` to open the leading master quickly. > And it has never work for `/master/redirect/xxx` before. > > > 2. xxx so I kind of expected > http://SOME_MASTER:5050/master/redirect/state to redirect to the master and > get the cluster state. > > I think just need to access `http://SOME_MASTER:5050/master/state` here. > If `SOME_MASTER` is not the leading master, it would redirct to > `http://LEADING_MASTER/master/state` automatically. This hehaviour never > change with 1.0 > > Charles Allen wrote: > Allright, I'll simplify the patch to only do the string starts with check.
@Haosdent simplified scope, and updated master comment testing info with new results. - Charles ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/52105/#review149824 ----------------------------------------------------------- On Sept. 22, 2016, 8:47 p.m., Charles Allen wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/52105/ > ----------------------------------------------------------- > > (Updated Sept. 22, 2016, 8:47 p.m.) > > > Review request for mesos and Vinod Kone. > > > Bugs: MESOS-6210 > https://issues.apache.org/jira/browse/MESOS-6210 > > > Repository: mesos > > > Description > ------- > > Prevent `/redirect/foo` loop. > > > Diffs > ----- > > 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: Thu, 22 Sep 2016 20:35:18 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/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 307 Temporary Redirect > < Date: Thu, 22 Sep 2016 20:35:23 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/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: Thu, 22 Sep 2016 20:35:29 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/foo > * Trying 127.0.0.1... > * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0) > > GET /master/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: Thu, 22 Sep 2016 20:35:31 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/master/redirect/foo/bar > * Trying 127.0.0.1... > * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0) > > GET /master/redirect/foo/bar HTTP/1.1 > > Host: 127.0.0.1:5050 > > User-Agent: curl/7.43.0 > > Accept: */* > > > < HTTP/1.1 307 Temporary Redirect > < Date: Thu, 22 Sep 2016 20:35:34 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/bar > * Trying 127.0.0.1... > * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0) > > GET /redirect/foo/bar HTTP/1.1 > > Host: 127.0.0.1:5050 > > User-Agent: curl/7.43.0 > > Accept: */* > > > < HTTP/1.1 307 Temporary Redirect > < Date: Thu, 22 Sep 2016 20:35:41 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/redirectNOTFOUND/foo/bar > * Trying 127.0.0.1... > * Connected to 127.0.0.1 (127.0.0.1) port 5050 (#0) > > GET /redirectNOTFOUND/foo/bar HTTP/1.1 > > Host: 127.0.0.1:5050 > > User-Agent: curl/7.43.0 > > Accept: */* > > > < HTTP/1.1 404 Not Found > < Date: Thu, 22 Sep 2016 20:35:47 GMT > < 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 > >
