You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@aurora.apache.org by Joshua Cohen <jc...@apache.org> on 2015/12/18 00:03:15 UTC

Review Request 41534: Update leader redirection logic to return an error page if there is no leading scheduler.

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41534/
-----------------------------------------------------------

Review request for Aurora, Maxim Khutornenko and Bill Farner.


Repository: aurora


Description
-------

We'd like to serve Aurora through DNS rather than against the singleton serverset so that when there is no leader users get a friendly error page rather than a generic error (which inevitably leads to them coming to ask for support). In order to accomplish this, I've updated the `LeaderRedirectFilter` to return a 503 with an html body in the event there is no elected leader.


Diffs
-----

  src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java 2c86ddb0a44bcec03cd9305fa96201c214fc731c 
  src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java 51566e9ccddfd4921ba33f0ecfbf303fdab31549 
  src/main/resources/org/apache/aurora/scheduler/http/no-leader.html PRE-CREATION 
  src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java 152af0d511fdc26906a3f7428024e5af08daab6d 
  src/test/java/org/apache/aurora/scheduler/http/LeaderRedirectTest.java 98b6ef6304521c5f99a187e1c6d83a135e4cfabd 
  src/test/java/org/apache/aurora/scheduler/http/ServletFilterTest.java af1e5f1c4c82ab2450c1487af67bc8907675822c 

Diff: https://reviews.apache.org/r/41534/diff/


Testing
-------

./gradlew build -Pq

Also verified in Vagrant (by preventing the scheduler from leading) that accessing the scheduler in that state returns the expected page.
Additionally verified that client error message is still usable:

    WARN] Connection error with scheduler: Unknown error talking to http://192.168.33.7:8081/api: 503 Server Error: Service Unavailable, reconnecting...


File Attachments
----------------

No Leader page
  https://reviews.apache.org/media/uploaded/files/2015/12/17/2759a88b-a2c4-4c45-a45f-037126e30f1e__Screen_Shot_2015-12-17_at_5.02.51_PM.png


Thanks,

Joshua Cohen


Re: Review Request 41534: Update leader redirection logic to return an error page if there is no leading scheduler.

Posted by Aurora ReviewBot <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41534/#review111492
-----------------------------------------------------------

Ship it!


Master (5183fe0) is green with this patch.
  ./build-support/jenkins/build.sh

I will refresh this build result if you post a review containing "@ReviewBot retry"

- Aurora ReviewBot


On Dec. 21, 2015, 4:40 p.m., Joshua Cohen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41534/
> -----------------------------------------------------------
> 
> (Updated Dec. 21, 2015, 4:40 p.m.)
> 
> 
> Review request for Aurora, Maxim Khutornenko and Bill Farner.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> We'd like to serve Aurora through DNS rather than against the singleton serverset so that when there is no leader users get a friendly error page rather than a generic error (which inevitably leads to them coming to ask for support). In order to accomplish this, I've updated the `LeaderRedirectFilter` to return a 503 with an html body in the event there is no elected leader.
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java 2c86ddb0a44bcec03cd9305fa96201c214fc731c 
>   src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java 51566e9ccddfd4921ba33f0ecfbf303fdab31549 
>   src/main/resources/org/apache/aurora/scheduler/http/no-leader.html PRE-CREATION 
>   src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java 152af0d511fdc26906a3f7428024e5af08daab6d 
>   src/test/java/org/apache/aurora/scheduler/http/LeaderRedirectTest.java 98b6ef6304521c5f99a187e1c6d83a135e4cfabd 
>   src/test/java/org/apache/aurora/scheduler/http/ServletFilterTest.java af1e5f1c4c82ab2450c1487af67bc8907675822c 
> 
> Diff: https://reviews.apache.org/r/41534/diff/
> 
> 
> Testing
> -------
> 
> ./gradlew build -Pq
> 
> Also verified in Vagrant (by preventing the scheduler from leading) that accessing the scheduler in that state returns the expected page.
> Additionally verified that client error message is still usable:
> 
>     WARN] Connection error with scheduler: Unknown error talking to http://192.168.33.7:8081/api: 503 Server Error: Service Unavailable, reconnecting...
> 
> 
> File Attachments
> ----------------
> 
> No Leader page
>   https://reviews.apache.org/media/uploaded/files/2015/12/17/2759a88b-a2c4-4c45-a45f-037126e30f1e__Screen_Shot_2015-12-17_at_5.02.51_PM.png
> 
> 
> Thanks,
> 
> Joshua Cohen
> 
>


Re: Review Request 41534: Update leader redirection logic to return an error page if there is no leading scheduler.

Posted by Joshua Cohen <jc...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41534/
-----------------------------------------------------------

(Updated Dec. 21, 2015, 4:40 p.m.)


Review request for Aurora, Maxim Khutornenko and Bill Farner.


Changes
-------

Updates based on review feedback:

- Remove use of additional endpoints.
- Tweaked copy on no leader page.


Repository: aurora


Description
-------

We'd like to serve Aurora through DNS rather than against the singleton serverset so that when there is no leader users get a friendly error page rather than a generic error (which inevitably leads to them coming to ask for support). In order to accomplish this, I've updated the `LeaderRedirectFilter` to return a 503 with an html body in the event there is no elected leader.


Diffs (updated)
-----

  src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java 2c86ddb0a44bcec03cd9305fa96201c214fc731c 
  src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java 51566e9ccddfd4921ba33f0ecfbf303fdab31549 
  src/main/resources/org/apache/aurora/scheduler/http/no-leader.html PRE-CREATION 
  src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java 152af0d511fdc26906a3f7428024e5af08daab6d 
  src/test/java/org/apache/aurora/scheduler/http/LeaderRedirectTest.java 98b6ef6304521c5f99a187e1c6d83a135e4cfabd 
  src/test/java/org/apache/aurora/scheduler/http/ServletFilterTest.java af1e5f1c4c82ab2450c1487af67bc8907675822c 

Diff: https://reviews.apache.org/r/41534/diff/


Testing
-------

./gradlew build -Pq

Also verified in Vagrant (by preventing the scheduler from leading) that accessing the scheduler in that state returns the expected page.
Additionally verified that client error message is still usable:

    WARN] Connection error with scheduler: Unknown error talking to http://192.168.33.7:8081/api: 503 Server Error: Service Unavailable, reconnecting...


File Attachments
----------------

No Leader page
  https://reviews.apache.org/media/uploaded/files/2015/12/17/2759a88b-a2c4-4c45-a45f-037126e30f1e__Screen_Shot_2015-12-17_at_5.02.51_PM.png


Thanks,

Joshua Cohen


Re: Review Request 41534: Update leader redirection logic to return an error page if there is no leading scheduler.

Posted by Bill Farner <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41534/#review111090
-----------------------------------------------------------

Ship it!


Overall this looks fine.  You did uncover some legacy cruft that might deserve some attention now, however.  Happy to offer more thoughts/details on that if needed.


src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java (lines 92 - 100)
<https://reviews.apache.org/r/41534/#comment171071>

    Feel free to update this section to just use the primary endpoint.



src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java (lines 138 - 141)
<https://reviews.apache.org/r/41534/#comment171069>

    It should be safe to disregard additional endpoints, it's a relic from when the scheduler had separate thrift and HTTP ports.



src/main/resources/org/apache/aurora/scheduler/http/no-leader.html (line 39)
<https://reviews.apache.org/r/41534/#comment171072>

    Not a strong opinion, but consider alternate wording:
    
    ```
    <p>
    It appears that the scheduler is failing over, which is routine behavior that should last no more than a few minutes.
    </p>
    ```


- Bill Farner


On Dec. 17, 2015, 3:03 p.m., Joshua Cohen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41534/
> -----------------------------------------------------------
> 
> (Updated Dec. 17, 2015, 3:03 p.m.)
> 
> 
> Review request for Aurora, Maxim Khutornenko and Bill Farner.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> We'd like to serve Aurora through DNS rather than against the singleton serverset so that when there is no leader users get a friendly error page rather than a generic error (which inevitably leads to them coming to ask for support). In order to accomplish this, I've updated the `LeaderRedirectFilter` to return a 503 with an html body in the event there is no elected leader.
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java 2c86ddb0a44bcec03cd9305fa96201c214fc731c 
>   src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java 51566e9ccddfd4921ba33f0ecfbf303fdab31549 
>   src/main/resources/org/apache/aurora/scheduler/http/no-leader.html PRE-CREATION 
>   src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java 152af0d511fdc26906a3f7428024e5af08daab6d 
>   src/test/java/org/apache/aurora/scheduler/http/LeaderRedirectTest.java 98b6ef6304521c5f99a187e1c6d83a135e4cfabd 
>   src/test/java/org/apache/aurora/scheduler/http/ServletFilterTest.java af1e5f1c4c82ab2450c1487af67bc8907675822c 
> 
> Diff: https://reviews.apache.org/r/41534/diff/
> 
> 
> Testing
> -------
> 
> ./gradlew build -Pq
> 
> Also verified in Vagrant (by preventing the scheduler from leading) that accessing the scheduler in that state returns the expected page.
> Additionally verified that client error message is still usable:
> 
>     WARN] Connection error with scheduler: Unknown error talking to http://192.168.33.7:8081/api: 503 Server Error: Service Unavailable, reconnecting...
> 
> 
> File Attachments
> ----------------
> 
> No Leader page
>   https://reviews.apache.org/media/uploaded/files/2015/12/17/2759a88b-a2c4-4c45-a45f-037126e30f1e__Screen_Shot_2015-12-17_at_5.02.51_PM.png
> 
> 
> Thanks,
> 
> Joshua Cohen
> 
>


Re: Review Request 41534: Update leader redirection logic to return an error page if there is no leading scheduler.

Posted by Aurora ReviewBot <wf...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41534/#review111093
-----------------------------------------------------------

Ship it!


Master (93fb2c7) is green with this patch.
  ./build-support/jenkins/build.sh

I will refresh this build result if you post a review containing "@ReviewBot retry"

- Aurora ReviewBot


On Dec. 17, 2015, 11:03 p.m., Joshua Cohen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41534/
> -----------------------------------------------------------
> 
> (Updated Dec. 17, 2015, 11:03 p.m.)
> 
> 
> Review request for Aurora, Maxim Khutornenko and Bill Farner.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> We'd like to serve Aurora through DNS rather than against the singleton serverset so that when there is no leader users get a friendly error page rather than a generic error (which inevitably leads to them coming to ask for support). In order to accomplish this, I've updated the `LeaderRedirectFilter` to return a 503 with an html body in the event there is no elected leader.
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java 2c86ddb0a44bcec03cd9305fa96201c214fc731c 
>   src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java 51566e9ccddfd4921ba33f0ecfbf303fdab31549 
>   src/main/resources/org/apache/aurora/scheduler/http/no-leader.html PRE-CREATION 
>   src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java 152af0d511fdc26906a3f7428024e5af08daab6d 
>   src/test/java/org/apache/aurora/scheduler/http/LeaderRedirectTest.java 98b6ef6304521c5f99a187e1c6d83a135e4cfabd 
>   src/test/java/org/apache/aurora/scheduler/http/ServletFilterTest.java af1e5f1c4c82ab2450c1487af67bc8907675822c 
> 
> Diff: https://reviews.apache.org/r/41534/diff/
> 
> 
> Testing
> -------
> 
> ./gradlew build -Pq
> 
> Also verified in Vagrant (by preventing the scheduler from leading) that accessing the scheduler in that state returns the expected page.
> Additionally verified that client error message is still usable:
> 
>     WARN] Connection error with scheduler: Unknown error talking to http://192.168.33.7:8081/api: 503 Server Error: Service Unavailable, reconnecting...
> 
> 
> File Attachments
> ----------------
> 
> No Leader page
>   https://reviews.apache.org/media/uploaded/files/2015/12/17/2759a88b-a2c4-4c45-a45f-037126e30f1e__Screen_Shot_2015-12-17_at_5.02.51_PM.png
> 
> 
> Thanks,
> 
> Joshua Cohen
> 
>


Re: Review Request 41534: Update leader redirection logic to return an error page if there is no leading scheduler.

Posted by Maxim Khutornenko <ma...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/41534/#review111099
-----------------------------------------------------------

Ship it!


Ship It!

- Maxim Khutornenko


On Dec. 17, 2015, 11:03 p.m., Joshua Cohen wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/41534/
> -----------------------------------------------------------
> 
> (Updated Dec. 17, 2015, 11:03 p.m.)
> 
> 
> Review request for Aurora, Maxim Khutornenko and Bill Farner.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> We'd like to serve Aurora through DNS rather than against the singleton serverset so that when there is no leader users get a friendly error page rather than a generic error (which inevitably leads to them coming to ask for support). In order to accomplish this, I've updated the `LeaderRedirectFilter` to return a 503 with an html body in the event there is no elected leader.
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/scheduler/http/LeaderRedirect.java 2c86ddb0a44bcec03cd9305fa96201c214fc731c 
>   src/main/java/org/apache/aurora/scheduler/http/LeaderRedirectFilter.java 51566e9ccddfd4921ba33f0ecfbf303fdab31549 
>   src/main/resources/org/apache/aurora/scheduler/http/no-leader.html PRE-CREATION 
>   src/test/java/org/apache/aurora/scheduler/http/AbstractJettyTest.java 152af0d511fdc26906a3f7428024e5af08daab6d 
>   src/test/java/org/apache/aurora/scheduler/http/LeaderRedirectTest.java 98b6ef6304521c5f99a187e1c6d83a135e4cfabd 
>   src/test/java/org/apache/aurora/scheduler/http/ServletFilterTest.java af1e5f1c4c82ab2450c1487af67bc8907675822c 
> 
> Diff: https://reviews.apache.org/r/41534/diff/
> 
> 
> Testing
> -------
> 
> ./gradlew build -Pq
> 
> Also verified in Vagrant (by preventing the scheduler from leading) that accessing the scheduler in that state returns the expected page.
> Additionally verified that client error message is still usable:
> 
>     WARN] Connection error with scheduler: Unknown error talking to http://192.168.33.7:8081/api: 503 Server Error: Service Unavailable, reconnecting...
> 
> 
> File Attachments
> ----------------
> 
> No Leader page
>   https://reviews.apache.org/media/uploaded/files/2015/12/17/2759a88b-a2c4-4c45-a45f-037126e30f1e__Screen_Shot_2015-12-17_at_5.02.51_PM.png
> 
> 
> Thanks,
> 
> Joshua Cohen
> 
>