----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/28838/#review64416 -----------------------------------------------------------
THanks for the quick fix! 3rdparty/libprocess/src/process.cpp <https://reviews.apache.org/r/28838/#comment107112> Consider using hashmap/hashset as it's performance critical. 3rdparty/libprocess/src/process.cpp <https://reviews.apache.org/r/28838/#comment107115> This needs more comments. It's quite difficult to digest initially. Some graph might be helpful. ``` linker -----> linkee (ProcessBase*) link() (UPID) ``` And ```remotes``` is for tracking remote linkees. Multiple remote linkees from the same remote node is tracked in ```remotes``` so that we can get those remote linkees when the socket for that node is closed. 3rdparty/libprocess/src/process.cpp <https://reviews.apache.org/r/28838/#comment107117> This doesn't seem to be necessary to me? Especially if you use hashmap? 3rdparty/libprocess/src/process.cpp <https://reviews.apache.org/r/28838/#comment107116> This looks a little weired, isn't it? You try to find "linkers", but you are actually calling "links.linkees". Maybe we should swap linkees and linkers in "links"? In that way: linkers[pid] means pid is the linkee and find all the linkers to the linkee? - Jie Yu On Dec. 9, 2014, 7:01 a.m., Ben Mahler wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/28838/ > ----------------------------------------------------------- > > (Updated Dec. 9, 2014, 7:01 a.m.) > > > Review request for mesos, Benjamin Hindman, Jie Yu, and Joris Van Remoortere. > > > Bugs: MESOS-2182 > https://issues.apache.org/jira/browse/MESOS-2182 > > > Repository: mesos-git > > > Description > ------- > > See MESOS-2182. > > The iteration over the links is expensive _and_ occurs within the > SocketManager's critical section, which we think is having some bad effects > blocking other calls (see the comments in the ticket). > > This change updates the socket manager to keep a bi-directional mapping > between the "linkers" and the "linkees", which means that we now only look at > the relevant information when a node/process exits. > > Note that I did double lookups on the maps, this was because we do this > heavily in libprocess already. I had originally written out the code using > .find() to avoid the double lookups, but it became next to impossible to > read. Let's micro-optimize later, this is a major improvement as it is. :) > > I tried to keep the additional complexity in check, let me know if there are > any suggestions to make it easier! > > > Diffs > ----- > > 3rdparty/libprocess/src/process.cpp > 4db7d56af710577e08a9d7dbeb92a1f01559401f > > Diff: https://reviews.apache.org/r/28838/diff/ > > > Testing > ------- > > make check > > Manually started a master and slave across machines, to ensure exit > notifications were sent correctly. > > > Thanks, > > Ben Mahler > >
