From f0f62136a7d9fa8c1f9b7d74b19f1556b62cd600 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Thu, 16 Jul 2015 10:55:38 +1000 Subject: [PATCH] Killed the stale random delays feature. --- fuseutil/file_system.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/fuseutil/file_system.go b/fuseutil/file_system.go index 7951ffa..7aa1b45 100644 --- a/fuseutil/file_system.go +++ b/fuseutil/file_system.go @@ -15,20 +15,13 @@ package fuseutil import ( - "flag" "io" - "math/rand" "sync" - "time" "github.com/jacobsa/fuse" "github.com/jacobsa/fuse/fuseops" ) -var fRandomDelays = flag.Bool( - "fuseutil.random_delays", false, - "If set, randomly delay each op received, to help expose concurrency issues.") - // An interface with a method for each op type in the fuseops package. This can // be used in conjunction with NewFileSystemServer to avoid writing a "dispatch // loop" that switches on op types, instead receiving typed method calls @@ -115,13 +108,6 @@ func (s *fileSystemServer) ServeOps(c *fuse.Connection) { func (s *fileSystemServer) handleOp(op fuseops.Op) { defer s.opsInFlight.Done() - // Delay if requested. - if *fRandomDelays { - const delayLimit = 100 * time.Microsecond - delay := time.Duration(rand.Int63n(int64(delayLimit))) - time.Sleep(delay) - } - // Dispatch to the appropriate method. var err error switch typed := op.(type) {