mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anand Mazumdar <an...@apache.org>
Subject Re: Review Request 58512: Avoid a crash in HTTP decoder.
Date Wed, 19 Apr 2017 04:02:28 GMT

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



Looks good! Thanks for reporting the issue and also fixing it.

Can you add a test to go along with the fix? Otherwise, under the "Testing Done" section,
the tests are _always_ expected to pass with/without the fix.


3rdparty/libprocess/src/decoder.hpp
Lines 699-701 (patched)
<https://reviews.apache.org/r/58512/#comment245418>

    Kill this comment. 
    
    In the decoder/encoder code using the http parser, it's fairly self-explanatory that the
next callback is only invoked if the previous one succeeded. We do however, want to add a
comment in the `on_message_complete()` handler though when this is not true.



3rdparty/libprocess/src/decoder.hpp
Line 711 (original), 714-716 (patched)
<https://reviews.apache.org/r/58512/#comment245420>

    ```cpp
    // Note that `decoder->writer` can be `None()`.
    ```
    hmm, this is evident from the conditional check later. 
    
    Let's add a comment around when this can happen. How about:
    
    ```cpp
    // This can happen if the callback `on_headers_complete()` had failed
    // earlier (e.g., due to invalid query parameters).
    ```



3rdparty/libprocess/src/decoder.hpp
Lines 987-989 (patched)
<https://reviews.apache.org/r/58512/#comment245431>

    Ditto as above.



3rdparty/libprocess/src/decoder.hpp
Line 1006 (original), 1017-1019 (patched)
<https://reviews.apache.org/r/58512/#comment245432>

    Ditto as above.


- Anand Mazumdar


On April 18, 2017, 6:04 p.m., Anindya Sinha wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/58512/
> -----------------------------------------------------------
> 
> (Updated April 18, 2017, 6:04 p.m.)
> 
> 
> Review request for mesos, Anand Mazumdar, James Peach, and Jiang Yan Xu.
> 
> 
> Bugs: MESOS-7400
>     https://issues.apache.org/jira/browse/MESOS-7400
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> If the callback `on_headers_complete()` fails, the decoder's writer
> object is `None()`. So, when the callback `on_message_complete()` is
> called, we should not crash in that case.
> Note that the `CHECK(decoder->writer)` is valid for the callback
> `on_body()` is valid since this callback is called only on a success
> in `on_headers_complete()` callback.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/decoder.hpp 4c779d42548958e610142438a57529ccb4478053 
> 
> 
> Diff: https://reviews.apache.org/r/58512/diff/1/
> 
> 
> Testing
> -------
> 
> All tests passed.
> 
> 
> Thanks,
> 
> Anindya Sinha
> 
>


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