perkeep/cmd
Brad Fitzpatrick ee4550bff4 camput: fix deadlock when uploading a large directory tree
The upload was constrained to have only 5 workers goroutines at a
time, but those goroutines could have been uploading directories and
blocked waiting for their dependent children, which never got to
upload if all 5 goroutines were uploading directories.

Now, allow an unlimited number of upload goroutines (see commit
058434449), but add a gate around things that allocate file
descriptors within the upload function.

This means that now we could have a ton of goroutines existing but
blocked on the gate, wasting ~4KB of memory each rather than the
relatively small amount of memory we used for the *node on the
container/list before.

Future CLs can reduce the memory usage and/or rewrite this.

Or maybe we forget to clean this up, but get smaller goroutine memory
usage in Go 1.3 as is being discussed.  It _is_ convenient to just
launch tons of goroutines and manage dependencies with channel
operations rather than managing the dependencies state and goroutine
scheduling in your own code, just to save some memory.

Change-Id: I43d9d7795e5df4d790d6086d18e4b4b99eaacbc8
2013-09-10 20:16:16 -07:00
..
camget all: delete pkg/blobref; convert all from *blobref.BlobRef to new blob.Ref 2013-08-03 19:54:30 -07:00
cammount all: delete pkg/blobref; convert all from *blobref.BlobRef to new blob.Ref 2013-08-03 19:54:30 -07:00
camput camput: fix deadlock when uploading a large directory tree 2013-09-10 20:16:16 -07:00
camtool Cleanup: remove BlobHub and time.Duration waits from storage interface 2013-08-21 13:57:28 -07:00