aurora-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Farner <wfar...@apache.org>
Subject Re: Review Request 45511: AURORA-1493: create ELB-friendly endpoint to detect leading scheduler
Date Thu, 31 Mar 2016 18:26:08 GMT

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




src/main/java/org/apache/aurora/scheduler/http/LeaderHealth.java (line 47)
<https://reviews.apache.org/r/45511/#comment189372>

    Let's make this endpoint browser-friendly too and include some text.  How about something
like:
    
    ```
    This is the leading scheduler.
    
    This endpoint can indicate to a load balancer which of a group of schedulers is leading.
 The response codes are:
    200: This is the leading scheduler.
    xxx: Another scheduler is leading.
    yyy: There is no leader currently, or the leader is unknown.
    ```



src/main/java/org/apache/aurora/scheduler/http/LeaderHealth.java (line 52)
<https://reviews.apache.org/r/45511/#comment189373>

    I'm not fond of a 500, as it's typically reserved for cases of genuine unknown error.
 503 seems more appropriate if it's all the same.



src/main/java/org/apache/aurora/scheduler/http/LeaderHealth.java (line 54)
<https://reviews.apache.org/r/45511/#comment189375>

    Is it useful to send a different status code for this state?  Seems like it doesn't make
a difference to a load balancer, and trying to differentiate forces use of an awkward code.



src/test/java/org/apache/aurora/scheduler/http/LeaderHealthTest.java (lines 54 - 58)
<https://reviews.apache.org/r/45511/#comment189381>

    `LeaderHealth` only cares about interfacing with `LeaderRedirect`, and therefore a unit
test should aim to avoid pulling in other details of the `LeaderRedirect` implementation.
    
    You should be fine to only mock `LeaderRedirect` in this test.



src/test/java/org/apache/aurora/scheduler/http/LeaderHealthTest.java (line 104)
<https://reviews.apache.org/r/45511/#comment189376>

    this should be +4 indent, not +8


- Bill Farner


On March 30, 2016, 10:06 p.m., Ashwin Murthy wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/45511/
> -----------------------------------------------------------
> 
> (Updated March 30, 2016, 10:06 p.m.)
> 
> 
> Review request for Aurora and Bill Farner.
> 
> 
> Repository: aurora
> 
> 
> Description
> -------
> 
> AURORA-1493: create ELB-friendly endpoint to detect leading scheduler. The fix is to
add a new endpoint - "/leaderhealth" which returns http status code 200 (OK) if the instance
is the leader. If the instance is not the leader but a leading exists, returns 500 (Internal
server error). If there is no leader at all, returns 503 (Service unavailable)
> 
> 
> Diffs
> -----
> 
>   src/main/java/org/apache/aurora/scheduler/http/LeaderHealth.java PRE-CREATION 
>   src/test/java/org/apache/aurora/scheduler/http/LeaderHealthTest.java PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/45511/diff/
> 
> 
> Testing
> -------
> 
> Added new unit test
> 
> 
> Thanks,
> 
> Ashwin Murthy
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message