diff --git a/.gitlab/test_cpp.sh b/.gitlab/test_cpp.sh index 1cdd4d44ba..a093182a2d 100755 --- a/.gitlab/test_cpp.sh +++ b/.gitlab/test_cpp.sh @@ -40,6 +40,7 @@ echo "==== Show system info ====" env nvidia-smi topo -m || true ibv_devinfo || true +uname -a || true echo "==== Running C++ tests ====" cd ${INSTALL_DIR} diff --git a/src/plugins/posix/posix_backend.cpp b/src/plugins/posix/posix_backend.cpp index 9a231cd44a..6181597de2 100644 --- a/src/plugins/posix/posix_backend.cpp +++ b/src/plugins/posix/posix_backend.cpp @@ -67,8 +67,9 @@ uringQueue::uringQueue(int num_entries, io_uring_params params) memset(&uring, 0, sizeof(uring)); int uring_init_status = io_uring_queue_init_params(num_entries, &uring, ¶ms); - if (uring_init_status != 0) - throw UringError::INIT; + if (uring_init_status != 0) { + throw std::runtime_error(absl::StrFormat("Failed to init io_uring - errno: %d", errno)); + } } uringQueue::~uringQueue() { @@ -156,7 +157,7 @@ nixlPosixBackendReqH::nixlPosixBackendReqH(const nixl_xfer_op_t &operation, reinterpret_cast(io_uring_prep_write)), is_prepped(false), status(NIXL_IN_PROG) { if (operation != NIXL_READ && operation != NIXL_WRITE) { - throw OperationError::INVALID_OPERATION; + throw std::invalid_argument(absl::StrFormat("Invalid operation type: %d", operation)); } fillUringParams(); @@ -247,10 +248,10 @@ nixl_status_t nixlPosixEngine::prepXfer(const nixl_xfer_op_t &operation, NIXL_RETURN_IF_NOT_IN_PROG(status); handle = posix_handle.release(); - } catch (nixlPosixBackendReqH::OperationError error) { - NIXL_LOG_AND_RETURN_IF_ERROR(NIXL_ERR_INVALID_PARAM, "Invalid operation type"); - } catch (const uringQueue::UringError& e) { - NIXL_LOG_AND_RETURN_IF_ERROR(NIXL_ERR_BACKEND, "Failed to init io_uring"); + } catch (const std::invalid_argument& e) { + NIXL_LOG_AND_RETURN_IF_ERROR(NIXL_ERR_INVALID_PARAM, e.what()); + } catch (const std::runtime_error& e) { + NIXL_LOG_AND_RETURN_IF_ERROR(NIXL_ERR_BACKEND, e.what()); } catch (const std::exception& e) { NIXL_LOG_AND_RETURN_IF_ERROR(NIXL_ERR_BACKEND, absl::StrFormat("Unexpected error: %s", e.what())); } diff --git a/src/plugins/posix/posix_backend.h b/src/plugins/posix/posix_backend.h index 1b928abc15..9c91746646 100644 --- a/src/plugins/posix/posix_backend.h +++ b/src/plugins/posix/posix_backend.h @@ -42,10 +42,6 @@ class uringQueue { nixl_status_t submit(); nixl_status_t checkCompleted(); struct io_uring_sqe *getSqe(); - - enum class UringError { - INIT, - }; }; class nixlPosixBackendReqH : public nixlBackendReqH { @@ -79,10 +75,6 @@ class nixlPosixBackendReqH : public nixlBackendReqH { nixl_status_t postXfer(); nixl_status_t prepXfer(); nixl_status_t checkXfer(); - - enum class OperationError { - INVALID_OPERATION - }; }; class nixlPosixEngine : public nixlBackendEngine {