cloudbase / wnbd

Windows Ceph RBD NBD driver
GNU Lesser General Public License v2.1
58 stars 26 forks source link

Refactor WNBD device handling #22

Closed petrutlucian94 closed 3 years ago

petrutlucian94 commented 3 years ago

Refactor WNBD device handling

At the moment, we have about 4 overlapping (providing the same fields), highly interconnected structures that describe a device, as well as two device lists. Locking isn't ideal either, we're using more locks than we need. Operations such as creating, listing or removing devices are holding exclusive locks more than they should.

At the same time, the device cleanup workflow is convoluted and doesn't guarantee that all the pending requests are completed by the time we cleanup disk devices or the entire extension, which often leads to memory leaks.

This refactoring is meant to greatly simplify device handling, making the driver easier to maintain and also avoid a few memory leaks. Here are the changes that we're going to make:

aserdean commented 3 years ago

The fixes found while are testing are in PR: https://github.com/cloudbase/wnbd/pull/23.

I'm closing this PR and merging it.