Commit f0f62136 authored by Aaron Jacobs's avatar Aaron Jacobs

Killed the stale random delays feature.

parent b44d3450
...@@ -15,20 +15,13 @@ ...@@ -15,20 +15,13 @@
package fuseutil package fuseutil
import ( import (
"flag"
"io" "io"
"math/rand"
"sync" "sync"
"time"
"github.com/jacobsa/fuse" "github.com/jacobsa/fuse"
"github.com/jacobsa/fuse/fuseops" "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 // 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 // be used in conjunction with NewFileSystemServer to avoid writing a "dispatch
// loop" that switches on op types, instead receiving typed method calls // loop" that switches on op types, instead receiving typed method calls
...@@ -115,13 +108,6 @@ func (s *fileSystemServer) ServeOps(c *fuse.Connection) { ...@@ -115,13 +108,6 @@ func (s *fileSystemServer) ServeOps(c *fuse.Connection) {
func (s *fileSystemServer) handleOp(op fuseops.Op) { func (s *fileSystemServer) handleOp(op fuseops.Op) {
defer s.opsInFlight.Done() 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. // Dispatch to the appropriate method.
var err error var err error
switch typed := op.(type) { switch typed := op.(type) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment