Hello eveyone!
According to below reproduce steps,you could observe a rsync hang:
1:configure and startup rsync service and
mkdir /root/a
mkdir /root/b
dd if=/dev/zero of=/root/b/1 bs=1M count=1
dd if=/dev/zero of=/root/b/2 bs=1M count=1
dd if=/dev/zero of=/root/b/3 bs=1M count=1
dd if=/dev/zero of=/root/b/4 bs=1M count=1
dd if=/dev/zero of=/root/b/5 bs=1M count=1
2: start testcase
./change-time-loop.sh > /dev/null &
./rsync-loop.sh
After applying this patch ,this issue went away.
--- rsync-2.6.9/BUILD/rsync-2.6.9/util.c    2014-11-11 
13:02:11.495609639 +0800
+++ rsync-2.6.9/BUILD/rsync-2.6.9/util.c    2014-11-11 
13:01:37.606569696 +0800
@@ -1174,8 +1174,11 @@
   * Always returns TRUE.  (In the future it might return FALSE if
   * interrupted.)
   **/
+
  int msleep(int t)
  {
+
+#if 0
      int tdiff = 0;
      struct timeval tval, t1, t2;
@@ -1192,7 +1195,8 @@
          tdiff = (t2.tv_sec - t1.tv_sec)*1000 +
              (t2.tv_usec - t1.tv_usec)/1000;
      }
-
+#endif
+  usleep(t*1000);
      return True;
  }
Is it a correct fix? any comments would be appreciated!!!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: change-time-loop.sh
Type: application/x-sh
Size: 114 bytes
Desc: not available
URL:
<http://lists.samba.org/pipermail/rsync/attachments/20141117/94f09798/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rsync-loop.sh
Type: application/x-sh
Size: 125 bytes
Desc: not available
URL:
<http://lists.samba.org/pipermail/rsync/attachments/20141117/94f09798/attachment-0001.sh>
On Sun, Nov 16, 2014 at 10:44 PM, yhu2 <yadi.hu at windriver.com> wrote:> + usleep(t*1000); > Is it a correct fix? any comments would be appreciated!!! >The hang was not because time went backwards, but because it moved forward by over 2 years (which overflows a variable, making the value negative). I both fixed that issue, and added a configure check for usleep(), which we will use if it is around. Thanks! ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20141127/7156677f/attachment.html>
thanks your reply, could you please send off official fix? On 11/28/2014 04:05 AM, Wayne Davison wrote:> On Sun, Nov 16, 2014 at 10:44 PM, yhu2 <yadi.hu at windriver.com > <mailto:yadi.hu at windriver.com>> wrote: > > + usleep(t*1000); > Is it a correct fix? any comments would be appreciated!!! > > > The hang was not because time went backwards, but because it moved > forward by over 2 years (which overflows a variable, making the value > negative). I both fixed that issue, and added a configure check for > usleep(), which we will use if it is around. Thanks! > > ..wayne..-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20141128/e3ca4ae3/attachment.html>