mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chun-Hung Hsiao <>
Subject Re: Review Request 70766: Fixed chaining futures infinitely in `UriDiskProfileAdaptor`.
Date Thu, 06 Jun 2019 04:58:51 GMT

This is an automatically generated e-mail. To reply, visit:

(Updated June 6, 2019, 4:58 a.m.)

Review request for mesos, Benjamin Bannier and Benjamin Mahler.


Made `watchers` a vector and avoided the use of iterators.

Bugs: MESOS-9803

Repository: mesos


Previously it is possible to have an infinite chain of futures when
`UriDiskProfileAdaptor::watch` is called: if the set of profiles remains
fixed for every poll, each poll would satisfy a promise that triggers
an asynchronous recursive call to `UriDiskProfileAdaptor::watch` again.

This patch fixes the problem by removing the asynchronous recursion.
Instead, we maintain a separated promise for each watcher that is never
associated to another promise. After each poll, we check if the current
set of profiles differs from the known set for a watcher, and satisfy
its own promise if so.

Diffs (updated)

  src/resource_provider/storage/uri_disk_profile_adaptor.hpp a5a34dc4dc1d518dc69aeb15fe62bd124d828ed3

  src/resource_provider/storage/uri_disk_profile_adaptor.cpp 215f7f92b5c2a0e60555134ce9887e8a187e3b1d




make check

Manually tested with the unit test in r/70764. The unit test will fail at the 5th poll without
the fix and will pass with the fix.


Chun-Hung Hsiao

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