You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by Chun-Hung Hsiao <ch...@mesosphere.io> on 2018/03/20 03:23:08 UTC

Re: Review Request 65640: Fixed leaks and a race condition in `UriDiskProfileAdaptorTests`.

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

(Updated March 20, 2018, 3:23 a.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Bannier, Jie Yu, and Joseph Wu.


Changes
-------

Rebased.


Summary (updated)
-----------------

Fixed leaks and a race condition in `UriDiskProfileAdaptorTests`.


Bugs: MESOS-8567
    https://issues.apache.org/jira/browse/MESOS-8567


Repository: mesos


Description
-------

There was a race between `Clock::advance()` in the `FetchFromHTTP` test
and `delay()` in `UriDiskProfileAdaptorProcess::_poll`. This patch
avoids the race by enforcing an order between the dispatch of the
`__poll` function (previously `_poll`) and the clock manipulation
in the test. It also fixed two memory leaks in the test.


Diffs (updated)
-----

  src/Makefile.am 84753794eca822ab251200cccb907b328c849fb7 
  src/resource_provider/storage/uri_disk_profile_adaptor.hpp PRE-CREATION 
  src/resource_provider/storage/uri_disk_profile_adaptor.cpp 665798fdb085ea34f93bd287fe6f9ab29a265cbf 
  src/tests/disk_profile_adaptor_tests.cpp 577ccfe9614009ba4178886c100de22ff12047b6 


Diff: https://reviews.apache.org/r/65640/diff/3/

Changes: https://reviews.apache.org/r/65640/diff/2-3/


Testing
-------

sudo make check


Thanks,

Chun-Hung Hsiao


Re: Review Request 65640: Fixed leaks and a race condition in `UriDiskProfileAdaptorTests`.

Posted by Joseph Wu <jo...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65640/#review201769
-----------------------------------------------------------




src/tests/disk_profile_adaptor_tests.cpp
Lines 453-457 (original), 451-457 (patched)
<https://reviews.apache.org/r/65640/#comment283353>

    FYI: I'm going to commit the leak fixes immediately as these leaks are causing ~200 extranous error log lines per build/test run.


- Joseph Wu


On April 11, 2018, 8:37 p.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65640/
> -----------------------------------------------------------
> 
> (Updated April 11, 2018, 8:37 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Benjamin Bannier, Jie Yu, and Joseph Wu.
> 
> 
> Bugs: MESOS-8567
>     https://issues.apache.org/jira/browse/MESOS-8567
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> There was a race between `Clock::advance()` in the `FetchFromHTTP` test
> and `delay()` in `UriDiskProfileAdaptorProcess::_poll`. This patch
> avoids the race by enforcing an order between the dispatch of the
> `__poll` function (previously `_poll`) and the clock manipulation
> in the test. It also fixed two memory leaks in the test.
> 
> 
> Diffs
> -----
> 
>   src/Makefile.am 257ff0e8d21e5240c27a123ed0cd563214e24fce 
>   src/resource_provider/storage/uri_disk_profile_adaptor.hpp 0484933b42d0bd66c689b06cb48f492eef7bc606 
>   src/resource_provider/storage/uri_disk_profile_adaptor.cpp 300ea12687de487737ce91066ab4e74d9b3430e6 
>   src/tests/disk_profile_adaptor_tests.cpp 948f6efc916d6fad0703944ad9acb77d85e4c25e 
> 
> 
> Diff: https://reviews.apache.org/r/65640/diff/4/
> 
> 
> Testing
> -------
> 
> sudo make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 65640: Fixed a race condition in `UriDiskProfileAdaptorTests`.

Posted by Chun-Hung Hsiao <ch...@apache.org>.

> On June 18, 2018, 1:38 p.m., Benjamin Bannier wrote:
> > src/Makefile.am
> > Lines 2517 (patched)
> > <https://reviews.apache.org/r/65640/diff/5/?file=2040461#file2040461line2517>
> >
> >     This looks unrelated, and AFAICT not needed.
> >     
> >     Let's remove this from the patch.

This is required for the test to use `FUTURE_DISPATCH` on `UriDiskProfileAdaptorProcess::_poll` without a link error.


- Chun-Hung


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


On June 14, 2018, 12:20 a.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65640/
> -----------------------------------------------------------
> 
> (Updated June 14, 2018, 12:20 a.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Benjamin Bannier, Jie Yu, and Joseph Wu.
> 
> 
> Bugs: MESOS-8567
>     https://issues.apache.org/jira/browse/MESOS-8567
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> There was a race between `Clock::advance()` in the `FetchFromHTTP` test
> and `delay()` in `UriDiskProfileAdaptorProcess::_poll`. This patch
> avoids the race by enforcing an order between the dispatch of the
> `__poll` function (previously `_poll`) and the clock manipulation
> in the test.
> 
> 
> Diffs
> -----
> 
>   src/Makefile.am 2bcee1e0e198e6be009174570cdaa1c8b8372a71 
>   src/resource_provider/storage/uri_disk_profile_adaptor.hpp 0484933b42d0bd66c689b06cb48f492eef7bc606 
>   src/resource_provider/storage/uri_disk_profile_adaptor.cpp 614590ef7d1c0cc1df99b8e57c7fbd496793b5a7 
>   src/tests/disk_profile_adaptor_tests.cpp 4485f1635f484ce6e1c7c532eedb277f5eee118b 
> 
> 
> Diff: https://reviews.apache.org/r/65640/diff/5/
> 
> 
> Testing
> -------
> 
> sudo make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 65640: Fixed a race condition in `UriDiskProfileAdaptorTests`.

Posted by Benjamin Bannier <be...@mesosphere.io>.

> On June 18, 2018, 3:38 p.m., Benjamin Bannier wrote:
> > src/Makefile.am
> > Lines 2517 (patched)
> > <https://reviews.apache.org/r/65640/diff/5/?file=2040461#file2040461line2517>
> >
> >     This looks unrelated, and AFAICT not needed.
> >     
> >     Let's remove this from the patch.
> 
> Chun-Hung Hsiao wrote:
>     This is required for the test to use `FUTURE_DISPATCH` on `UriDiskProfileAdaptorProcess::_poll` without a link error.

The symbols from that file are already in `liburi_disk_profile_adaptor` and we should not add them directly here (if we'd link to the library in the future we'd have ODR violations). Instead we should link `libmesos` or `mesos_tests` with that library; the cmake build links `libmesos` with `liburi_disk_profile_adaptor`.


- Benjamin


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


On June 14, 2018, 2:20 a.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65640/
> -----------------------------------------------------------
> 
> (Updated June 14, 2018, 2:20 a.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Benjamin Bannier, Jie Yu, and Joseph Wu.
> 
> 
> Bugs: MESOS-8567
>     https://issues.apache.org/jira/browse/MESOS-8567
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> There was a race between `Clock::advance()` in the `FetchFromHTTP` test
> and `delay()` in `UriDiskProfileAdaptorProcess::_poll`. This patch
> avoids the race by enforcing an order between the dispatch of the
> `__poll` function (previously `_poll`) and the clock manipulation
> in the test.
> 
> 
> Diffs
> -----
> 
>   src/Makefile.am 2bcee1e0e198e6be009174570cdaa1c8b8372a71 
>   src/resource_provider/storage/uri_disk_profile_adaptor.hpp 0484933b42d0bd66c689b06cb48f492eef7bc606 
>   src/resource_provider/storage/uri_disk_profile_adaptor.cpp 614590ef7d1c0cc1df99b8e57c7fbd496793b5a7 
>   src/tests/disk_profile_adaptor_tests.cpp 4485f1635f484ce6e1c7c532eedb277f5eee118b 
> 
> 
> Diff: https://reviews.apache.org/r/65640/diff/5/
> 
> 
> Testing
> -------
> 
> sudo make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 65640: Fixed a race condition in `UriDiskProfileAdaptorTests`.

Posted by Benjamin Bannier <be...@mesosphere.io>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65640/#review204923
-----------------------------------------------------------


Fix it, then Ship it!





src/Makefile.am
Lines 2517 (patched)
<https://reviews.apache.org/r/65640/#comment287727>

    This looks unrelated, and AFAICT not needed.
    
    Let's remove this from the patch.



src/resource_provider/storage/uri_disk_profile_adaptor.hpp
Line 233 (original), 235 (patched)
<https://reviews.apache.org/r/65640/#comment287728>

    Nit: remove this line.


- Benjamin Bannier


On June 14, 2018, 2:20 a.m., Chun-Hung Hsiao wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/65640/
> -----------------------------------------------------------
> 
> (Updated June 14, 2018, 2:20 a.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Benjamin Bannier, Jie Yu, and Joseph Wu.
> 
> 
> Bugs: MESOS-8567
>     https://issues.apache.org/jira/browse/MESOS-8567
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> There was a race between `Clock::advance()` in the `FetchFromHTTP` test
> and `delay()` in `UriDiskProfileAdaptorProcess::_poll`. This patch
> avoids the race by enforcing an order between the dispatch of the
> `__poll` function (previously `_poll`) and the clock manipulation
> in the test.
> 
> 
> Diffs
> -----
> 
>   src/Makefile.am 2bcee1e0e198e6be009174570cdaa1c8b8372a71 
>   src/resource_provider/storage/uri_disk_profile_adaptor.hpp 0484933b42d0bd66c689b06cb48f492eef7bc606 
>   src/resource_provider/storage/uri_disk_profile_adaptor.cpp 614590ef7d1c0cc1df99b8e57c7fbd496793b5a7 
>   src/tests/disk_profile_adaptor_tests.cpp 4485f1635f484ce6e1c7c532eedb277f5eee118b 
> 
> 
> Diff: https://reviews.apache.org/r/65640/diff/5/
> 
> 
> Testing
> -------
> 
> sudo make check
> 
> 
> Thanks,
> 
> Chun-Hung Hsiao
> 
>


Re: Review Request 65640: Fixed a race condition in `UriDiskProfileAdaptorTests`.

Posted by Chun-Hung Hsiao <ch...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65640/
-----------------------------------------------------------

(Updated July 6, 2018, 11:23 p.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Bannier, Jie Yu, and Joseph Wu.


Changes
-------

Rebased.


Bugs: MESOS-8567
    https://issues.apache.org/jira/browse/MESOS-8567


Repository: mesos


Description
-------

There was a race between `Clock::advance()` in the `FetchFromHTTP` test
and `delay()` in `UriDiskProfileAdaptorProcess::_poll`. This patch
avoids the race by enforcing an order between the dispatch of the
`__poll` function (previously `_poll`) and the clock manipulation
in the test.


Diffs (updated)
-----

  src/Makefile.am 3ac1e1ce650d7238c108d0ac4123228500053a6f 
  src/resource_provider/storage/uri_disk_profile_adaptor.hpp 0484933b42d0bd66c689b06cb48f492eef7bc606 
  src/resource_provider/storage/uri_disk_profile_adaptor.cpp 614590ef7d1c0cc1df99b8e57c7fbd496793b5a7 
  src/tests/disk_profile_adaptor_tests.cpp 4485f1635f484ce6e1c7c532eedb277f5eee118b 


Diff: https://reviews.apache.org/r/65640/diff/7/

Changes: https://reviews.apache.org/r/65640/diff/6-7/


Testing
-------

sudo make check


Thanks,

Chun-Hung Hsiao


Re: Review Request 65640: Fixed a race condition in `UriDiskProfileAdaptorTests`.

Posted by Chun-Hung Hsiao <ch...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65640/
-----------------------------------------------------------

(Updated June 20, 2018, 5:32 a.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Bannier, Jie Yu, and Joseph Wu.


Changes
-------

Addressed Benjamin's comments.


Bugs: MESOS-8567
    https://issues.apache.org/jira/browse/MESOS-8567


Repository: mesos


Description
-------

There was a race between `Clock::advance()` in the `FetchFromHTTP` test
and `delay()` in `UriDiskProfileAdaptorProcess::_poll`. This patch
avoids the race by enforcing an order between the dispatch of the
`__poll` function (previously `_poll`) and the clock manipulation
in the test.


Diffs (updated)
-----

  src/Makefile.am 2bcee1e0e198e6be009174570cdaa1c8b8372a71 
  src/resource_provider/storage/uri_disk_profile_adaptor.hpp 0484933b42d0bd66c689b06cb48f492eef7bc606 
  src/resource_provider/storage/uri_disk_profile_adaptor.cpp 614590ef7d1c0cc1df99b8e57c7fbd496793b5a7 
  src/tests/disk_profile_adaptor_tests.cpp 4485f1635f484ce6e1c7c532eedb277f5eee118b 


Diff: https://reviews.apache.org/r/65640/diff/6/

Changes: https://reviews.apache.org/r/65640/diff/5-6/


Testing
-------

sudo make check


Thanks,

Chun-Hung Hsiao


Re: Review Request 65640: Fixed a race condition in `UriDiskProfileAdaptorTests`.

Posted by Chun-Hung Hsiao <ch...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65640/
-----------------------------------------------------------

(Updated June 14, 2018, 12:20 a.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Bannier, Jie Yu, and Joseph Wu.


Changes
-------

Rebased.


Summary (updated)
-----------------

Fixed a race condition in `UriDiskProfileAdaptorTests`.


Bugs: MESOS-8567
    https://issues.apache.org/jira/browse/MESOS-8567


Repository: mesos


Description (updated)
-------

There was a race between `Clock::advance()` in the `FetchFromHTTP` test
and `delay()` in `UriDiskProfileAdaptorProcess::_poll`. This patch
avoids the race by enforcing an order between the dispatch of the
`__poll` function (previously `_poll`) and the clock manipulation
in the test.


Diffs (updated)
-----

  src/Makefile.am 2bcee1e0e198e6be009174570cdaa1c8b8372a71 
  src/resource_provider/storage/uri_disk_profile_adaptor.hpp 0484933b42d0bd66c689b06cb48f492eef7bc606 
  src/resource_provider/storage/uri_disk_profile_adaptor.cpp 614590ef7d1c0cc1df99b8e57c7fbd496793b5a7 
  src/tests/disk_profile_adaptor_tests.cpp 4485f1635f484ce6e1c7c532eedb277f5eee118b 


Diff: https://reviews.apache.org/r/65640/diff/5/

Changes: https://reviews.apache.org/r/65640/diff/4-5/


Testing
-------

sudo make check


Thanks,

Chun-Hung Hsiao


Re: Review Request 65640: Fixed leaks and a race condition in `UriDiskProfileAdaptorTests`.

Posted by Chun-Hung Hsiao <ch...@apache.org>.
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/65640/
-----------------------------------------------------------

(Updated April 12, 2018, 3:37 a.m.)


Review request for mesos, Alexander Rukletsov, Benjamin Bannier, Jie Yu, and Joseph Wu.


Changes
-------

Rebased.


Bugs: MESOS-8567
    https://issues.apache.org/jira/browse/MESOS-8567


Repository: mesos


Description
-------

There was a race between `Clock::advance()` in the `FetchFromHTTP` test
and `delay()` in `UriDiskProfileAdaptorProcess::_poll`. This patch
avoids the race by enforcing an order between the dispatch of the
`__poll` function (previously `_poll`) and the clock manipulation
in the test. It also fixed two memory leaks in the test.


Diffs (updated)
-----

  src/Makefile.am 257ff0e8d21e5240c27a123ed0cd563214e24fce 
  src/resource_provider/storage/uri_disk_profile_adaptor.hpp 0484933b42d0bd66c689b06cb48f492eef7bc606 
  src/resource_provider/storage/uri_disk_profile_adaptor.cpp 300ea12687de487737ce91066ab4e74d9b3430e6 
  src/tests/disk_profile_adaptor_tests.cpp 948f6efc916d6fad0703944ad9acb77d85e4c25e 


Diff: https://reviews.apache.org/r/65640/diff/4/

Changes: https://reviews.apache.org/r/65640/diff/3-4/


Testing
-------

sudo make check


Thanks,

Chun-Hung Hsiao