Commit Graph

12 Commits (6fcbbe86634f133171b3eafe860b1104620195e8)

Author SHA1 Message Date
Paul Morie 1294267450 Improve godoc for goroutinemap 2016-08-25 14:25:05 -04:00
Jing Xu f19a1148db This change supports robust kubelet volume cleanup
Currently kubelet volume management works on the concept of desired
and actual world of states. The volume manager periodically compares the
two worlds and perform volume mount/unmount and/or attach/detach
operations. When kubelet restarts, the cache of those two worlds are
gone. Although desired world can be recovered through apiserver, actual
world can not be recovered which may cause some volumes cannot be cleaned
up if their information is deleted by apiserver. This change adds the
reconstruction of the actual world by reading the pod directories from
disk. The reconstructed volume information is added to both desired
world and actual world if it cannot be found in either world. The rest
logic would be as same as before, desired world populator may clean up
the volume entry if it is no longer in apiserver, and then volume
manager should invoke unmount to clean it up.
2016-08-15 11:29:15 -07:00
Matt T. Proud 4e0a1858f9 pkg/util/goroutinemap: apply idiomatic Go cleanups
Package goroutinemap can be structurally simplified to be more
idiomatic, concise, and free of error potential.  No structural changes
are made.

It is unconventional declare `sync.Mutex` directly as a pointerized
field in a parent structure.  The `sync.Mutex` operates on pointer
receivers of itself; and by relying on that, the types that contain
those fields can be safely constructed using
https://golang.org/ref/spec#The_zero_value.

The duration constants are already of type `time.Duration`, so
re-declaring that is redundant.
2016-07-26 07:00:26 +02:00
saadali 88d495026d Allow mounts to run in parallel for non-attachable
Allow mount volume operations to run in parallel for non-attachable
volume plugins.

Allow unmount volume operations to run in parallel for all volume
plugins.
2016-07-19 21:54:26 -07:00
k8s-merge-robot 5b3b655710 Merge pull request #28153 from jsafrane/flaky-goroutinemap-wait
Automatic merge from submit-queue

Fixed goroutinemap race on Wait()

sync.WaitGroup produces data races when a GoroutineMap is empty and Wait() and Run() are called at the same time.

From sync.WaitGroup:

>  Note that calls with a positive delta that occur when the counter is zero must happen before a Wait.

Fixes #28128
Note that this issue affects only PersistentVolume unit tests.

@saad-ali, PTAL
2016-06-29 19:54:05 -07:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Jan Safranek 06082b1bdf Fixed goroutinemap race on Wait()
sync.WaitGroup produces data races when a GoroutineMap is empty and Wait() and
Run() are called at the same time.

From sync.WaitGroup:
   Note that calls with a positive delta that occur when the counter is zero
   must happen before a Wait.

Fixes #28128
2016-06-28 12:04:45 +02:00
saadali e716ddc771 Controller wait for attach and exponential backoff
Modify attach/detach controller to keep track of volumes to report
attached in Node VolumeToAttach status.

Modify kubelet volume manager to wait for volume to show up in Node
VolumeToAttach status.

Implement exponential backoff for errors in volume manager and attach
detach controller
2016-06-20 18:19:55 -07:00
Jan Safranek e5bea6abba Add specific error type for "operation already exists" error.
PersistentVolume controller needs to know why scheduling a new operation has
failed - if the operation was already running or some other error happened.
2016-05-16 10:43:42 +02:00
saadali f7196337c7 Rename NewGoRoutine to Run in GoRoutineMap 2016-05-13 16:05:55 -07:00
Jan Safranek 6623385d64 Add GoRoutineMap.Wait method.
It's useful for testing - code under tests creates an operation and my test
needs to wait until the operation finishes before evaluating results.
2016-05-10 10:11:08 +02:00
saadali 53bb527e35 Introduce a data structure for managing go routines by unique name. 2016-05-02 12:02:34 -07:00