----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/34646/#review89799 -----------------------------------------------------------
Looks great, thanks! I still wonder if we can remove some of the duplication between redirect() and redirectRequestToLeader(). Otherwise just minor feedback. src/master/http.cpp (line 424) <https://reviews.apache.org/r/34646/#comment142698> Is there a way you could reuse all or part of Http::redirect()? Seems like a lot of copy/paste. src/master/http.cpp (line 427) <https://reviews.apache.org/r/34646/#comment142694> Nit: Comments should end in punctuation. src/master/http.cpp (lines 429 - 433) <https://reviews.apache.org/r/34646/#comment142695> Please wrap at 80 characters. Suggested rewording: "Current master is not elected as leader, and leader information is unavailable. Failed to redirect the request url: " << request.url src/master/http.cpp (line 434) <https://reviews.apache.org/r/34646/#comment142696> Why not a "503 Service Unavailable", meaning "The server is currently unavailable (because it is overloaded or down for maintenance). Generally, this is a temporary state."? src/master/http.cpp (lines 438 - 441) <https://reviews.apache.org/r/34646/#comment142697> Please wrap at 80 characters. Suggested rewording: "Current master is not elected leader. Redirecting the request url " << request.url << " to the leading master " << hostname src/master/http.cpp (line 454) <https://reviews.apache.org/r/34646/#comment142596> Remove "http:", like we're doing for the rest of https/SSL support. See https://reviews.apache.org/r/36018/diff src/master/http.cpp (line 471) <https://reviews.apache.org/r/34646/#comment142699> s/leader master/leading master/g src/master/master.hpp (line 1096) <https://reviews.apache.org/r/34646/#comment142700> s/Reredirect/Redirect/ s/leader master/leading master/ - Adam B On June 1, 2015, 8:07 a.m., haosdent huang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/34646/ > ----------------------------------------------------------- > > (Updated June 1, 2015, 8:07 a.m.) > > > Review request for mesos and Adam B. > > > Bugs: MESOS-1865 > https://issues.apache.org/jira/browse/MESOS-1865 > > > Repository: mesos > > > Description > ------- > > Return empty task list when current master is not a leader. > > > Diffs > ----- > > src/master/http.cpp 01dbdad9720a9cd30505683ae1117970cda918a0 > src/master/master.hpp c0cc2933a2cc094401f633df12356bda3d294564 > > Diff: https://reviews.apache.org/r/34646/diff/ > > > Testing > ------- > > make check > > when current master is not a leader, it would redirect to the leader master. > > ``` > $ curl -i http://master1:5050/master/tasks.json > HTTP/1.1 307 Temporary Redirect > Date: Mon, 01 Jun 2015 06:30:08 GMT > Location: http://master2:5050//master/tasks.json > Content-Length: 0 > ``` > > > Thanks, > > haosdent huang > >
