<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">&lt;<a href="mailto:xemul@parallels.com" target="_blank">xemul@parallels.com</a>&gt;</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>
&gt;<br>
&gt;<br>
&gt; 2015-06-04 23:30 GMT+03:00 Pavel Emelyanov &lt;<a href="mailto:xemul@parallels.com">xemul@parallels.com</a> &lt;mailto:<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>&gt;&gt;:<br>
<span class="">&gt;<br>
&gt;     On 06/04/2015 07:35 PM, Artem Kuzmitskiy wrote:<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
</span>&gt;     &gt; 2015-06-04 16:42 GMT+03:00 Pavel Emelyanov &lt;<a href="mailto:xemul@parallels.com">xemul@parallels.com</a> &lt;mailto:<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>&gt; &lt;mailto:<a href="mailto:xemul@parallels.com">xemul@parallels.com</a> &lt;mailto:<a href="mailto:xemul@parallels.com">xemul@parallels.com</a>&gt;&gt;&gt;:<br>
<span class="">&gt;     &gt;<br>
&gt;     &gt;     &gt; Hi all,<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; We&#39;re returned back at this problem..<br>
&gt;     &gt;<br>
&gt;     &gt;     Cool :)<br>
&gt;     &gt;<br>
&gt;     &gt;     &gt;&gt;     &gt;     &gt; The usage scenario is following: I&#39;m having a parent process and a child processes bidirectonal communicating<br>
&gt;     &gt;     &gt;&gt;     &gt;     &gt; via stream Unix socket. The idea is to dump child process when it&#39;s not needed and to restore it<br>
&gt;     &gt;     &gt;&gt;     &gt;     &gt; again later<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; This task still need for us and we did some test with upstream version of CRIU.<br>
&gt;     &gt;     &gt; Code of test stub here -&gt; <a href="http://pastebin.com/tLnRdE3K" target="_blank">http://pastebin.com/tLnRdE3K</a><br>
&gt;     &gt;     &gt; CRIU called with next params:<br>
&gt;     &gt;     &gt; for dump -&gt; ${CRIU_bin} dump -vvvv -o &lt;PID&gt;.log -D ${DIR} -t &lt;PID&gt; -d --shell-job --ext-unix-sk<br>
&gt;     &gt;     &gt; for restore -&gt; ${CRIU_bin} restore -vvvv -o &lt;PID&gt;.log -D ${DIR}  -d --shell-job --ext-unix-sk<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; Test case: child write in a unix sock, parent read from unix sock.<br>
&gt;     &gt;     &gt; Child proccess dumped&amp;restored, but<br>
&gt;     &gt;     &gt;  - only if we don&#39;t close sockets after fork (sock[0] in child and sock[1] in parent respectively) otherwise restore process failed<br>
&gt;     &gt;<br>
&gt;     &gt;     Can you share the restore logs?<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; yes sure:<br>
&gt;     &gt; test stub -&gt; <a href="http://pastebin.com/iBuQy0CL" target="_blank">http://pastebin.com/iBuQy0CL</a><br>
&gt;     &gt; dump log -&gt; <a href="http://pastebin.com/9ysvQ69m" target="_blank">http://pastebin.com/9ysvQ69m</a><br>
&gt;     &gt; restorel log -&gt;  <a href="http://pastebin.com/HR459Diu" target="_blank">http://pastebin.com/HR459Diu</a><br>
&gt;<br>
&gt;     Heh :) This is external dgram socket w/o a name. Can happen if it&#39;s a socketpair, but<br>
&gt;     criu errorneously tries to connect() them back. Bug in CRIU, thanks!<br>
&gt;<br>
&gt;<br>
&gt; yep.....also we tested same scenario but using named unix socket for IPC with SOCK_DGRAM param (test stub code -&gt; <a href="http://pastebin.com/QRYrV3LW" target="_blank">http://pastebin.com/QRYrV3LW</a>) and it works fine.<br>
&gt; If sockets has SOCK_SEQPACKET or SOCK_STREAM dump failed(sk-unix.c:546 ) and it&#39;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&#39;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&#39;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&#39;s socket you propose using   &quot;--ext-unix-sk $id (to be impl)&quot; on dump and &quot;inheriting (to be impl too)&quot; 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>