<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-06-04 23:30 GMT+03:00 Pavel Emelyanov <span dir="ltr"><<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On 06/04/2015 07:35 PM, Artem Kuzmitskiy wrote:<br>
><br>
><br>
> 2015-06-04 16:42 GMT+03:00 Pavel Emelyanov <<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a> <mailto:<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>>>:<br>
<span>><br>
> > Hi all,<br>
> ><br>
> > We're returned back at this problem..<br>
><br>
> Cool :)<br>
><br>
> >> > > The usage scenario is following: I'm having a parent process and a child processes bidirectonal communicating<br>
> >> > > via stream Unix socket. The idea is to dump child process when it's not needed and to restore it<br>
> >> > > again later<br>
> ><br>
> > This task still need for us and we did some test with upstream version of CRIU.<br>
> > Code of test stub here -> <a href="http://pastebin.com/tLnRdE3K" target="_blank">http://pastebin.com/tLnRdE3K</a><br>
> > CRIU called with next params:<br>
> > for dump -> ${CRIU_bin} dump -vvvv -o <PID>.log -D ${DIR} -t <PID> -d --shell-job --ext-unix-sk<br>
> > for restore -> ${CRIU_bin} restore -vvvv -o <PID>.log -D ${DIR} -d --shell-job --ext-unix-sk<br>
> ><br>
> > Test case: child write in a unix sock, parent read from unix sock.<br>
> > Child proccess dumped&restored, but<br>
> > - only if we don't close sockets after fork (sock[0] in child and sock[1] in parent respectively) otherwise restore process failed<br>
><br>
> Can you share the restore logs?<br>
><br>
><br>
> yes sure:<br>
> test stub -> <a href="http://pastebin.com/iBuQy0CL" target="_blank">http://pastebin.com/iBuQy0CL</a><br>
> dump log -> <a href="http://pastebin.com/9ysvQ69m" target="_blank">http://pastebin.com/9ysvQ69m</a><br>
> restorel log -> <a href="http://pastebin.com/HR459Diu" target="_blank">http://pastebin.com/HR459Diu</a><br>
<br>
</span>Heh :) This is external dgram socket w/o a name. Can happen if it's a socketpair, but<br>
criu errorneously tries to connect() them back. Bug in CRIU, thanks!</blockquote><div> </div><div>yep.....also we tested same scenario but using named unix socket for IPC with SOCK_DGRAM param (test stub code -> <a href="http://pastebin.com/QRYrV3LW" target="_blank">http://pastebin.com/QRYrV3LW</a>) and it works fine.</div><div>If sockets has SOCK_SEQPACKET or SOCK_STREAM dump failed(sk-unix.c:546 ) and it's current limitation of CRIU.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span><br>
> > 3. Do you have any ideas which can help us make a dump\restore of child proccess with CRIU?<br>
><br>
> Not sure I understand this correctly, would you describe in more details, please?<br>
><br>
><br>
> We have parent process which forks few child processes and exchange with child processes using pair of sockets returned from socketpair(with option SOCK_SEQPACKET or SOCK_STREAM).<br>
> We would like to dump child(s) and full-featured restore them.<br>
<br>
</span>Ah, I see. Such sockets should be dumped and restored using the --inherit-fd option [1].<br>
We don't yet have it working with unix sockets, only regular files and pipes, but adding<br>
unix sockets should be not extremely hard.<br></blockquote><div><br></div><div>Thx.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><div><br>
[1] <a href="http://criu.org/Inheriting_FDs_on_restore" target="_blank">http://criu.org/Inheriting_FDs_on_restore</a><br>
<br>
<br>
-- Pavel<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><div dir="ltr">Best regards,<div>Artem Kuzmitskiy</div><div><br></div></div></div></div></div>
</div></div>