You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@mesos.apache.org by haosdent huang <ha...@gmail.com> on 2016/01/20 03:29:36 UTC

Re: Review Request 40266: Libprocess Reinitialization: Cleanup SocketManager along side ProcessManager.

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



3rdparty/libprocess/src/process.cpp (line 1306)
<https://reviews.apache.org/r/40266/#comment176291>

    Is it possible sockets not empty when exit this loop?


- haosdent huang


On Dec. 3, 2015, 12:50 a.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40266/
> -----------------------------------------------------------
> 
> (Updated Dec. 3, 2015, 12:50 a.m.)
> 
> 
> Review request for mesos, Artem Harutyunyan and Joris Van Remoortere.
> 
> 
> Bugs: MESOS-3910
>     https://issues.apache.org/jira/browse/MESOS-3910
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The `SocketManager` and `ProcessManager` are highly inter-dependent, which requires some untangling in `process::finalize`.
> 
> * Logic originally found in `~ProcessManager` has been split into `ProcessManager::finalize` due to what happens during cleanup.
> * Some additional cleanup was added for dangling pointers.
> * The future from `__s__->accept()` must be explicitly discarded as libevent does not detect a locally closed socket.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/process.cpp a7af4671efa2f370137ed4a749e5247c91e6f95e 
> 
> Diff: https://reviews.apache.org/r/40266/diff/
> 
> 
> Testing
> -------
> 
> `make check` (libev)
> `make check` (--enable-libevent --enable-ssl)
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>


Re: Review Request 40266: Libprocess Reinitialization: Cleanup SocketManager along side ProcessManager.

Posted by Joseph Wu <jo...@mesosphere.io>.

> On Jan. 19, 2016, 6:29 p.m., haosdent huang wrote:
> > 3rdparty/libprocess/src/process.cpp, line 1306
> > <https://reviews.apache.org/r/40266/diff/2/?file=1151884#file1151884line1306>
> >
> >     Is it possible sockets not empty when exit this loop?

Definitely possible.  We currently do not track the futures from `socket->send()` (specifically the calls in `internal::send(Encoder* encoder, Socket* socket)`).

i.e.
1) We call `ProcessBase::send` to a remote process.
2) Libprocess creates a socket and starts to write data.
3) We call `process::finalize` (+ this patch).
4) The main process exits, but does not necessarily clean up the socket created during `ProcessBase::send`.
5) SocketManager cleanup happens, which closes the socket, but doesn't finish sending first.

---

Seems like it would be fairly simple to track the futures from `internal::send(Encoder* encoder, Socket* socket)` and wait for them to finish during finalization.
(As is required in MESOS-4111.)


- Joseph


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


On Dec. 2, 2015, 4:50 p.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40266/
> -----------------------------------------------------------
> 
> (Updated Dec. 2, 2015, 4:50 p.m.)
> 
> 
> Review request for mesos, Artem Harutyunyan and Joris Van Remoortere.
> 
> 
> Bugs: MESOS-3910
>     https://issues.apache.org/jira/browse/MESOS-3910
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The `SocketManager` and `ProcessManager` are highly inter-dependent, which requires some untangling in `process::finalize`.
> 
> * Logic originally found in `~ProcessManager` has been split into `ProcessManager::finalize` due to what happens during cleanup.
> * Some additional cleanup was added for dangling pointers.
> * The future from `__s__->accept()` must be explicitly discarded as libevent does not detect a locally closed socket.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/process.cpp a7af4671efa2f370137ed4a749e5247c91e6f95e 
> 
> Diff: https://reviews.apache.org/r/40266/diff/
> 
> 
> Testing
> -------
> 
> `make check` (libev)
> `make check` (--enable-libevent --enable-ssl)
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>