content: add cross-process ingest locking

Allow content stores to ingest content without coordination of a daemon
to manage locks. Supports coordinated ingest and cross-process ingest
status.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
Stephen J Day 2016-11-15 19:46:24 -08:00
parent f832e757f8
commit b6e446e7be
No known key found for this signature in database
GPG key ID: FB5F6B2905D7ECF3
5 changed files with 112 additions and 12 deletions

View file

@ -47,6 +47,13 @@ func TestContentWriter(t *testing.T) {
t.Fatal(err)
}
// make sure that second resume also fails
if _, err = cs.Resume("myref"); err == nil {
// TODO(stevvooe): This also works across processes. Need to find a way
// to test that, as well.
t.Fatal("no error on second resume")
}
p := make([]byte, 4<<20)
if _, err := rand.Read(p); err != nil {
t.Fatal(err)