Files
kubernetes/pkg/volume
Kubernetes Submit Queue ddf4a0cad5 Merge pull request #40417 from jsravn/fix-reconciler-external-updates-race
Automatic merge from submit-queue (batch tested with PRs 41531, 40417, 41434)

Always detach volumes in operator executor

**What this PR does / why we need it**:

Instead of marking a volume as detached immediately in Kubelet's
reconciler, delegate the marking asynchronously to the operator
executor. This is necessary to prevent race conditions with other
operations mutating the same volume state.

An example of one such problem:

1. pod is created, volume is added to desired state of the world
2. reconciler process starts
3. reconciler starts MountVolume, which is kicked off asynchronously via
   operation_executor.go
4. MountVolume mounts the volume, but hasn't yet marked it as mounted
5. pod is deleted, volume is removed from desired state of the world
6. reconciler reaches detach volume section, detects volume is no longer in desired state of world,
   removes it from volumes in use
7. MountVolume tries to mark mount, throws an error because
   volume is no longer in actual state of world list. After this, kubelet isn't aware of the mount
   so doesn't try to unmount again.
8. controller-manager tries to detach the volume, this fails because it
   is still mounted to the OS.
9. EBS gets stuck indefinitely in busy state trying to detach.



**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #32881, fixes ##37854 (maybe)

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-02-15 23:01:07 -08:00
..
2017-01-29 21:41:45 +01:00
2017-02-10 22:22:32 +01:00
2017-01-23 20:12:24 -07:00
2017-01-29 21:41:45 +01:00
2017-01-29 21:41:45 +01:00
2017-01-29 21:41:45 +01:00
2017-01-29 21:41:45 +01:00
2017-01-29 21:41:45 +01:00
2017-01-29 21:41:45 +01:00
2017-01-23 20:12:24 -07:00
2017-01-29 21:41:45 +01:00
2017-01-29 21:41:45 +01:00
2017-01-29 21:41:45 +01:00
2016-07-16 13:48:21 -04:00
2017-01-17 16:05:40 -08:00
2017-01-29 21:41:44 +01:00