<div dir="ltr"><div>A theoretical way to test this against any other protocol is to have a firewall rule which can be triggered locally which just drops the traffic</div><div>and then re-enables the traffic in a while (short or long, can be decided/tweaked).</div><div>This way, there is no need to think about which protocol is used, when we kill the connectivity.<br></div><div>The only consideration could probably be that the dropped connections would cover only the ports we need. <br></div><div>To reduce the size of the hammer :)</div><div><br></div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><p style="margin:0px;padding:0px"><b style="font-family:arial,helvetica,sans-serif;font-size:small"><font color="#cc0000"><span style="margin:0px;padding:0px">Nenad Perić</span><span style="margin:0px;padding:0px"></span></font></b><br></p><p style="font-size:small;color:rgb(0,0,0);margin:0px;padding:0px"><span style="font-family:arial,helvetica,sans-serif;font-size:x-small">PRINCIPAL SOFTWARE ENGINEER</span><font size="1" face="arial, helvetica, sans-serif"><br style="margin:0px;padding:0px"></font></p><p style="font-size:small;margin:0px;padding:0px"><font size="1" face="arial, helvetica, sans-serif" color="#000000">Red Hat - Migration Engineering</font></p><p style="margin:0px;padding:0px"><font size="1" face="arial, helvetica, sans-serif"><span style="margin:0px;padding:0px"><span style="margin:0px;padding:0px"><a href="mailto:nenad@redhat.com" target="_blank"><font color="#0b5394">nenad@redhat.com </font></a></span></span><span style="margin:0px;padding:0px"></span></font></p><p style="margin:0px;padding:0px"><span style="margin:0px;padding:0px"><font size="1" face="arial, helvetica, sans-serif"><a href="http://redhat.com" style="color:rgb(0,0,0)" target="_blank"><img src="https://www.google.com/a/cpanel/redhat.com/images/logo.gif?service=google_gsuite" width="96" height="39"></a><font color="#000000"> </font><span style="margin:0px;padding:0px"></span></font></span></p></div></div></div></div></div></div></div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 19, 2019 at 1:34 PM Richard W.M. Jones <<a href="mailto:rjones@redhat.com">rjones@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This is a retry filter implementation as outlined here:<br>
<a href="https://www.redhat.com/archives/libguestfs/2019-September/msg00167.html" rel="noreferrer" target="_blank">https://www.redhat.com/archives/libguestfs/2019-September/msg00167.html</a><br>
<br>
It is only lightly tested.  One way to test it is to try an SSH copy<br>
(see the commit message for patch 2/2), and in the middle of the copy<br>
kill the per-connection sshd on the remote machine.  You will see that<br>
the copy recovers after a few seconds.  Add the nbdkit -v option to<br>
see some useful messages from the filter:<br>
<br>
  ...<br>
  nbdkit: ssh[1]: debug: ssh: pread count=2097152 offset=216006656<br>
  nbdkit: ssh[1]: error: read failed: Socket error: Connection reset by peer (-1)<br>
  nbdkit: ssh[1]: debug: retry 1: original errno = 5<br>
  nbdkit: ssh[1]: debug: waiting 2 seconds before retrying<br>
  nbdkit: ssh[1]: debug: ssh: reopen<br>
  nbdkit: ssh[1]: debug: close<br>
  nbdkit: ssh[1]: error: cannot close file: Socket error: Connection reset by peer<br>
  nbdkit: ssh[1]: debug: ssh: open readonly=0<br>
  nbdkit: ssh[1]: debug: opened libssh handle<br>
  nbdkit: ssh[1]: debug: ssh: pread count=2097152 offset=216006656<br>
  ...<br>
<br>
It really needs an actual test, which is tricky to implement.  My<br>
thinking currently is that a custom (sh) plugin is the way to go, but<br>
it would also be nice to test curl/ssh/vddk with this filter -- if<br>
anyone has any suggestions on how to do that ...<br>
<br>
This patch will probably conflict with Eric's series here:<br>
<a href="https://www.redhat.com/archives/libguestfs/2019-September/msg00180.html" rel="noreferrer" target="_blank">https://www.redhat.com/archives/libguestfs/2019-September/msg00180.html</a><br>
but that shouldn't be too hard to fix up.<br>
<br>
Rich.<br>
<br>
<br>
</blockquote></div>