{"record":{"id":"cbc2cf53d1f06bba","repo":"microsoft/FASTER","slug":"failed-to-schedule-async-io-handle","errorCode":null,"errorMessage":"Failed to schedule async IO: , handle ","messagePattern":"Failed to schedule async IO: , handle ","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cc/src/environment/file_windows.cc","lineNumber":362,"sourceCode":"\n  new(io_context.get()) QueueIoHandler::IoCallbackContext(offset, caller_context_copy,\n      callback);\n\n  bool success = FALSE;\n  if(FileOperationType::Read == operationType) {\n    success = ::ReadFile(file_handle_, buffer, length, nullptr, &io_context->parent_overlapped);\n  } else {\n    success = ::WriteFile(file_handle_, buffer, length, nullptr, &io_context->parent_overlapped);\n  }\n  if(!success) {\n    DWORD win32_result = ::GetLastError();\n    // Any error other than ERROR_IO_PENDING means the IO failed. Otherwise it will finish\n    // asynchronously on the threadpool\n    if(ERROR_IO_PENDING != win32_result) {\n      std::stringstream ss;\n      ss << \"Failed to schedule async IO: \" << FormatWin32AndHRESULT(win32_result) <<\n         \", handle \" << std::to_string((uint64_t)file_handle_);\n      fprintf(stderr, \"%s\\n\", ss.str().c_str());\n      return Status::IOError;\n    }\n  }\n  io_context.release();\n  return Status::Ok;\n}\n\n#undef DCHECK_ALIGNMENT\n\n}\n} // namespace FASTER::environment","sourceCodeStart":344,"sourceCodeEnd":373,"githubUrl":"https://github.com/microsoft/FASTER/blob/321d872eabda6a0345c8bd76419f89723ed864ae/cc/src/environment/file_windows.cc#L344-L373","documentation":"Same async-I/O scheduling failure as the preceding variant, but this class includes the underlying file handle in the diagnostic: 'Failed to schedule async IO: <win32 error>, handle <n>'. The overlapped call returned something other than ERROR_IO_PENDING, so Status::IOError is returned.","triggerScenarios":"Queuing async I/O on a Windows thread-pool file when the overlapped request fails immediately; the message's handle number identifies which file/device failed.","commonSituations":"Multiple devices where only one has gone bad (handle helps pinpoint it), unaligned buffers, quota/disk exhaustion, closed or corrupted handles.","solutions":["Use the printed handle number to identify the failing file/device","Resolve the underlying Win32 error shown by FormatWin32AndHRESULT","Check buffer alignment and I/O quotas; verify disk health and free space","Retry or reopen the device if the failure persists"],"exampleFix":"null","handlingStrategy":"try-catch","validationCode":"null","typeGuard":null,"tryCatchPattern":"Status s = op();\nif (s == Status::IOError) {\n  // parse handle from stderr line to identify failing device\n  // reopen device or fail over to healthy storage\n}","preventionTips":["Log device handle-to-path mappings at startup for diagnosis","Health-check storage devices before load","Align buffers and respect overlapped-I/O requirements"],"tags":["windows","async-io","win32","diagnostics"],"backgroundTag":"file-write-failed","analyzedSha":"321d872eabda6a0345c8bd76419f89723ed864ae","analyzedAt":"2026-09-15T22:18:00.693Z","contentChangedAt":"2026-09-15T22:18:00.693Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}