<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2015-06-04 16:42 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"><span class="">> Hi all,<br>
><br>
> We're returned back at this problem..<br>
<br>
</span>Cool :)<br>
<span class=""><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>
</span>Can you share the restore logs?<br></blockquote><div><br></div><div>yes sure:</div><div>test stub -> <a href="http://pastebin.com/iBuQy0CL">http://pastebin.com/iBuQy0CL</a></div><div>dump log -> <a href="http://pastebin.com/9ysvQ69m">http://pastebin.com/9ysvQ69m</a></div><div>restorel log -> <a href="http://pastebin.com/HR459Diu">http://pastebin.com/HR459Diu</a></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 class=""><br>
> - child PPID not equal parent pid<br>
> - connection lost<br>
><br>
> P.S. Also we are checked pipes (instead of socketpair)<br>
> Test case 1: child write in a pipe, parent read from pipe.<br>
> Child proccess dumped&restored, but<br>
> - child PPID not equal parent pid<br>
> - connection lost with another end of pipe(continue sending messages into pipe)<br>
> Test case 2: child read in a pipe, parent write from pipe.<br>
> As expected parent received SIGPIPE.<br>
><br>
> Sumary questions:<br>
> 1. Can we restored relation (subtree) between parent and child process?<br>
<br>
</span>Yes, for this the parent should call criu restore with the --restore-sibling option. Or<br>
use the criu_restore_child() library call. If you call restore from a non-parent process,<br>
then the linkage will not be restored, there's no such API in the kernel.<br>
<br>
But hmm... this, in theory, can be implemented by putting the parasite into the parent,<br>
then calling fork_with_pid() from it and continuing restore. Need to think about it...</blockquote><div><br></div><div>Ok, thx. We'll check this option.</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"> </blockquote><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"> </blockquote><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=""><br>
> 2. Do you have a plan for imp of dump\restore functionality for unix sockets with<br>
> option SOCK_SEQPACKET and SOCK_STREAM (created by socketpair call) in near time?<br>
<br>
</span>You mean external sockets? Well, I have plan how to do it, but can't guarantee you<br>
whether I will be able to allocate time for it. If you'll be able to do it, then<br>
contributions are welcome :) and from my side I can guarantee the necessary level<br>
of advises, comments and review. </blockquote><div><br></div><div>Thx, I'll discuss with my team and give you know.</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=""><br>
> 3. Do you have any ideas which can help us make a dump\restore of child proccess with CRIU?<br>
<br>
</span>Not sure I understand this correctly, would you describe in more details, please?<br></blockquote><div><br></div><div>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).</div><div>We would like to dump child(s) and full-featured restore them.</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 class="gmail_signature"><div dir="ltr">Best regards,<div>Artem Kuzmitskiy</div><div><br></div></div></div></div></div>
</div></div>