Skip to content

Commit

Permalink
fix(volume): set threadiness to 1 for volume workers (#24)
Browse files Browse the repository at this point in the history
set no of threads for volume workers to 1 to avoid race condition
while deleting partitions using parted.

Signed-off-by: Akhil Mohan <akhil.mohan@mayadata.io>
  • Loading branch information
akhilerm authored Jul 14, 2021
1 parent a09f6e7 commit 5204a17
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/mgmt/volume/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ func Start(controllerMtx *sync.RWMutex, stopCh <-chan struct{}) error {
go VolInformerFactory.Start(stopCh)

// Threadiness defines the number of workers to be launched in Run function
return controller.Run(2, stopCh)
// The no.of threads is set to 1 here as using `parted` command for creation/deletion
// of partitions from multiple threads can lead to race condition and eventually some
// partitions not getting cleaned up from the disk.
// Ref: https://github.com/openebs/device-localpv/issues/21
return controller.Run(1, stopCh)
}

// GetClusterConfig return the config for k8s.
Expand Down

0 comments on commit 5204a17

Please sign in to comment.