[CRIU] Dumping of stream unix connection

Pavel Emelyanov xemul at parallels.com
Fri Mar 27 09:52:48 PDT 2015


On 03/27/2015 07:27 PM, Anatoly Baranov wrote:
> 
> 2015-03-25 17:08 GMT+03:00 Pavel Emelyanov <xemul at parallels.com <mailto:xemul at parallels.com>>:
> 
>     On 03/25/2015 05:00 PM, Anatoly Baranov wrote:
>     >
>     > 2015-03-25 15:57 GMT+03:00 Pavel Emelyanov <xemul at parallels.com <mailto:xemul at parallels.com> <mailto:xemul at parallels.com <mailto:xemul at parallels.com>>>:
>     >
>     >     On 03/25/2015 01:46 PM, Анатолий Баранов wrote:
>     >     > Hi all,
>     >     > I found that there are troubles with dumping of stream Unix connection: when I'm trying to
>     >     > checkpoint it, I'm receiving "Can't dump half of stream Unix connection" message.
>     >     > I've found this thread: http://lists.openvz.org/pipermail/criu/2013-June/009320.html but it
>     >     > didn't help.
>     >     > The usage scenario is following: I'm having a parent process and a child processes communicating
>     >     > via stream Unix socket. The idea is to dump child process when it's not needed and to restore it
>     >     > again later,
>     >
>     >     But what to do with this connection upon restore?
>     >
>     > Sorry, but I'm afraid, I didn't understand you question. I intended to continue sending streamed data
>     > from the point where it was dumped. Did you mean I won't be able to use the connection after I restore it?
> 
>     Well, child will be able to do it, but what about parent? Once you dumped the child
>     and killed one parent would notice the EOF on the socket and will close it. So after
>     restore of child there will be no "peer" to send data to.
> 
> 
> Hi again,
> 
> I can see few hypothetical possibilities here:
> 1) I can try to keep the socket in parent process alive if possible. For example, I can try to not to send EOF from the child process.

You can't force child not to send EOF :) Kernel will do it for you once child is
dumped AND killed afterwards.

> 2) I can try to embed criu in parent process and build logic around it, for example re-open parent socket when restoring child.

Well, if you control the parent, then this situation can be resolved. What you're
trying to achieve seems to be the case for FD inheritance on restore [1]. We have
it implemented for pipes and regular files only, so we'll need to extend that logic
on unix sockets as well :)

[1] http://criu.org/Inheriting_FDs_on_restore

-- Pavel


More information about the CRIU mailing list