<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-06-05 16:36 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/05/2015 04:25 PM, Artem Kuzmitskiy wrote:<br>
><br>
><br>
> 2015-06-04 23:30 GMT+03:00 Pavel Emelyanov <<a href="mailto:xemul@parallels.com">xemul@parallels.com</a> <mailto:<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>>>:<br>
<span class="">><br>
> On 06/04/2015 07:35 PM, Artem Kuzmitskiy wrote:<br>
> ><br>
> ><br>
</span>> > 2015-06-04 16:42 GMT+03:00 Pavel Emelyanov <<a href="mailto:xemul@parallels.com">xemul@parallels.com</a> <mailto:<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>> <mailto:<a href="mailto:xemul@parallels.com">xemul@parallels.com</a> <mailto:<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>>>>:<br>
<span class="">> ><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>
> 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!<br>
><br>
><br>
> 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.<br>
> If sockets has SOCK_SEQPACKET or SOCK_STREAM dump failed(sk-unix.c:546 ) and it's current limitation of CRIU.<br>
<br>
</span>Yes. The justification is simple -- the server will notice EOF on the socket if we dump it and we<br>
may not be able to connect one back on restore.<br>
<br>
However, I'm OK if someone sends a patch that extends the --ext-unix-sk option with the following<br>
semantics:<br>
<br>
- On dump --ext-unix-sk $id says that the stream/seqpacket socket $id is OK to be disconnected<br>
- On restore --ext-unix-sk $id:$path says that socket $id should be connect()-ed to $path. The<br>
$path may be absent meaning that the connction should go to the path seen on dump.<br>
<br>
Note, that this won't work for socketpairs() as they are name-less and cannot be reconnect-ed<br>
back. For those only inheriting will work.<br></blockquote><div><br></div><div>Am I right understood that for socketpair's socket you propose using "--ext-unix-sk $id (to be impl)" on dump and "inheriting (to be impl too)" for restore?</div><div>And thx for explanation.</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 class=""><font color="#888888"><br>
-- Pavel<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">Best regards,<div>Artem Kuzmitskiy</div><div><br></div></div></div></div></div>
</div></div>