Skip to content

Commit

Permalink
fix(csi-node): cherry-pick add noddy sleep between umount and disconnect
Browse files Browse the repository at this point in the history
Sometimes when disconnecting we see page read errors due to ENXIO.
There seems to be some race in the kernel when removing a device with queued IOs.
While this is not strictly an issue, it may confuse or hide other problems.
Although an ugly WA, sleeping between umount and disconnect seems to alleviate this.

Signed-off-by: Tiago Castro <[email protected]>
  • Loading branch information
tiagolobocastro committed Nov 28, 2022
1 parent 9a8a636 commit 4331c18
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions csi/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,13 @@ impl node_server::Node for Node {
// found.
unstage_fs_volume(&msg).await?;

// Sometimes when disconnecting we see page read errors due to ENXIO.
// There seems to be some race in the kernel when removing a device with
// queued IOs. While this is not strictly an issue, it may
// confuse or hide other problems. Sleeping between umount and
// disconnect seems to alleviate this.
tokio::time::sleep(std::time::Duration::from_secs(1)).await;

// unmounts (if any) are complete.
// If the device is attached, detach the device.
// Device::lookup will return None for nbd devices,
Expand Down

0 comments on commit 4331c18

Please sign in to comment.