mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neil Conway <>
Subject Review Request 46024: Avoided misleading locking in the libprocess SocketManager.
Date Mon, 11 Apr 2016 14:04:36 GMT

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

Review request for mesos and Ben Mahler.

Repository: mesos


In `SocketManager::swap_implementing_socket`, the previous coding
accessed the `sockets` instance variable in two CHECKs without
acquiring `mutex`. This is unsafe in general: `mutex` should be
acquired before accessing instance variables like `sockets` (unless
you know all such concurrent accesses will be read-only etc.).

As it happens, the previous coding was not unsafe because all the
call-sites of `SocketManager::swap_implementing_socket` acquire
`mutex` before invoking it. But because `swap_implementing_socket`
also acquires `mutex`, clearly its API contract allows it to be
invoked without holding `mutex`, in which case the CHECKs would
likely be unsafe.


  3rdparty/libprocess/src/process.cpp 5e9dcfdc52f3a8223bc43af149b8e1f5dbdf5b0a 




Neil Conway

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