mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Mahler <>
Subject Review Request 70927: Fixed a memory "leak" of filters in the allocator.
Date Fri, 21 Jun 2019 23:12:05 GMT

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

Review request for mesos, Andrei Sekretenko and Meng Zhu.

Bugs: MESOS-9852

Repository: mesos


Per MESOS-9852, the allocator does not keep a handle to the offer
filter timer, which means it cannot remove the timer if it's no
longer relevant (e.g. due to revive). This means that timers build
up in memory.

Also, the offer filter is allocated on the heap, and is not deleted
until the expiry of the timer (which may take forever!), even if the
offer filter is no longer relevant (e.g. due to revive). This means
that offer filters build up in memory.

The fix applied is to manage offer filters using a shared_ptr in the
maps, which means that they get deleted when erased. The expiration
functions need to now use a weak_ptr in case they run after the
offer filter has been erased (which is possible due to racing between
the expiry timer firing and the timer being discarded).

To discard the timers when no longer needed, the destructors of the
filters perform the discard.

This was tested against a test which spins in a revive + long decline
loop. Previously, the RSS continues to grow, but after this fix
it remains the same.


  src/master/allocator/mesos/hierarchical.hpp 25472eb7f5cb8342d2c88449c9c4145d816fb718 
  src/master/allocator/mesos/hierarchical.cpp 7076e968589c05c770cf50ad289bc7889625b54f 



make check in addition to the leak test described in the description
and included in the subsequent patch (that's not planned to be committed)


Benjamin Mahler

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