Skip to content

Commit 1553df5

Browse files
Jaesoo Leefacebook-github-bot
authored andcommitted
increase the retry limit on EBUSY error for device IOs
Summary: This change increases the retry limit on EBUSY errors for device IOs to 10,000. As discovered in T182829130, the device IO can return EBUSY, suspectedly, only for io_uring + md configuration due to a different way the partial EAGAINs for sub-ios are handled in the kernel. We don't apply any delay in-between retries to avoid additional latencies and 10000 retries should work for most cases. Reviewed By: liu-song-6 Differential Revision: D55495499 fbshipit-source-id: d3ffaf8524a85ed853998190e5a3e76d33a628f4
1 parent 69b91b5 commit 1553df5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

cachelib/navy/common/Device.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,8 +247,13 @@ class AsyncIoContext : public IoContext {
247247
// Prepare an Nvme CMD IO through IOUring
248248
std::unique_ptr<folly::AsyncBaseOp> prepNvmeIo(IOOp& op);
249249

250-
// The maximum number of retries when IO failed with EBUSY. 5 is arbitrary
251-
static constexpr size_t kRetryLimit = 5;
250+
// The maximum number of retries when IO failed with EBUSY.
251+
// For now, this could happen only for io_uring when combined with md
252+
// devices due to, suspectedly, a different way the partial EAGAINs for
253+
// sub-ios are handled in the kernel (see T182829130)
254+
// We don't apply any delay in-between retries to avoid additional latencies
255+
// and 10000 retries should work for most cases
256+
static constexpr size_t kRetryLimit = 10000;
252257

253258
// Waiter context to enforce the qdepth limit
254259
struct Waiter {

0 commit comments

Comments
 (0)