[ARVADOS] updated: 1.3.0-2598-g82357c206

Git user git at public.arvados.org
Wed May 20 14:11:05 UTC 2020


Summary of changes:
 services/keepstore/unix_volume.go      | 17 +++++++++++++++--
 services/keepstore/unix_volume_test.go |  4 ++--
 2 files changed, 17 insertions(+), 4 deletions(-)

       via  82357c206f796298d98f9c756963ddb60abccf79 (commit)
       via  14568bb4cda60d42812f785923c4da8ba30031e3 (commit)
       via  bd858d208b82a7a0ccaadf51b72af7087a6c0cea (commit)
       via  0098b7a718d7c23af9621cfccb1ee7a92512bf87 (commit)
      from  9007cff9babd5140d0b7bd0ded316afb3656d286 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 82357c206f796298d98f9c756963ddb60abccf79
Merge: 9007cff9b 14568bb4c
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Wed May 20 10:10:58 2020 -0400

    Merge branch '16319-timestamp-precision'
    
    refs #16319
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>


commit 14568bb4cda60d42812f785923c4da8ba30031e3
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Wed May 20 09:59:00 2020 -0400

    16319: Count Utimes stats.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/services/keepstore/unix_volume.go b/services/keepstore/unix_volume.go
index 7af058ae5..5026e2d32 100644
--- a/services/keepstore/unix_volume.go
+++ b/services/keepstore/unix_volume.go
@@ -304,6 +304,8 @@ func (v *UnixVolume) WriteBlock(ctx context.Context, loc string, rdr io.Reader)
 	// avoid this by setting the output file's timestamps
 	// explicitly, using a higher resolution clock.
 	ts := time.Now()
+	v.os.stats.TickOps("utimes")
+	v.os.stats.Tick(&v.os.stats.UtimesOps)
 	if err = os.Chtimes(tmpfile.Name(), ts, ts); err != nil {
 		err = fmt.Errorf("error setting timestamps on %s: %s", tmpfile.Name(), err)
 		v.os.Remove(tmpfile.Name())
diff --git a/services/keepstore/unix_volume_test.go b/services/keepstore/unix_volume_test.go
index 7777363b9..5a3a53694 100644
--- a/services/keepstore/unix_volume_test.go
+++ b/services/keepstore/unix_volume_test.go
@@ -405,13 +405,13 @@ func (s *UnixVolumeSuite) TestStats(c *check.C) {
 	c.Check(stats(), check.Matches, `.*"OutBytes":3,.*`)
 	c.Check(stats(), check.Matches, `.*"CreateOps":1,.*`)
 	c.Check(stats(), check.Matches, `.*"OpenOps":0,.*`)
-	c.Check(stats(), check.Matches, `.*"UtimesOps":0,.*`)
+	c.Check(stats(), check.Matches, `.*"UtimesOps":1,.*`)
 
 	err = vol.Touch(loc)
 	c.Check(err, check.IsNil)
 	c.Check(stats(), check.Matches, `.*"FlockOps":1,.*`)
 	c.Check(stats(), check.Matches, `.*"OpenOps":1,.*`)
-	c.Check(stats(), check.Matches, `.*"UtimesOps":1,.*`)
+	c.Check(stats(), check.Matches, `.*"UtimesOps":2,.*`)
 
 	_, err = vol.Get(context.Background(), loc, make([]byte, 3))
 	c.Check(err, check.IsNil)

commit bd858d208b82a7a0ccaadf51b72af7087a6c0cea
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Wed May 20 09:49:29 2020 -0400

    16319: Use stdlib func Chtimes instead of UtimesNano syscall.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/services/keepstore/unix_volume.go b/services/keepstore/unix_volume.go
index 9dbb0c3f3..7af058ae5 100644
--- a/services/keepstore/unix_volume.go
+++ b/services/keepstore/unix_volume.go
@@ -172,10 +172,10 @@ func (v *UnixVolume) Touch(loc string) error {
 		return e
 	}
 	defer v.unlockfile(f)
-	ts := syscall.NsecToTimespec(time.Now().UnixNano())
+	ts := time.Now()
 	v.os.stats.TickOps("utimes")
 	v.os.stats.Tick(&v.os.stats.UtimesOps)
-	err = syscall.UtimesNano(p, []syscall.Timespec{ts, ts})
+	err = os.Chtimes(p, ts, ts)
 	v.os.stats.TickErr(err)
 	return err
 }
@@ -303,8 +303,8 @@ func (v *UnixVolume) WriteBlock(ctx context.Context, loc string, rdr io.Reader)
 	// which produces confusing results in logs and tests.  We
 	// avoid this by setting the output file's timestamps
 	// explicitly, using a higher resolution clock.
-	ts := syscall.NsecToTimespec(time.Now().UnixNano())
-	if err = syscall.UtimesNano(tmpfile.Name(), []syscall.Timespec{ts, ts}); err != nil {
+	ts := time.Now()
+	if err = os.Chtimes(tmpfile.Name(), ts, ts); err != nil {
 		err = fmt.Errorf("error setting timestamps on %s: %s", tmpfile.Name(), err)
 		v.os.Remove(tmpfile.Name())
 		return err

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list