forked from mooncake-track/Mooncake
fix(store): replace CHECK with error handling (#735)
This commit is contained in:
parent
bdc7ffb86d
commit
335d1a1b70
|
|
@ -157,10 +157,7 @@ class TransferEngineOperationState : public OperationState {
|
|||
public:
|
||||
TransferEngineOperationState(TransferEngine& engine, BatchID batch_id,
|
||||
size_t batch_size)
|
||||
: engine_(engine), batch_id_(batch_id), batch_size_(batch_size) {
|
||||
CHECK(batch_id_ != Transport::INVALID_BATCH_ID)
|
||||
<< "Invalid batch ID for transfer engine operation";
|
||||
}
|
||||
: engine_(engine), batch_id_(batch_id), batch_size_(batch_size) {}
|
||||
|
||||
~TransferEngineOperationState() { engine_.freeBatchID(batch_id_); }
|
||||
|
||||
|
|
|
|||
|
|
@ -203,7 +203,10 @@ ErrorCode Client::InitTransferEngine(const std::string& local_hostname,
|
|||
auto [hostname, port] = parseHostNameWithPort(local_hostname);
|
||||
int rc = transfer_engine_.init(metadata_connstring, local_hostname,
|
||||
hostname, port);
|
||||
CHECK_EQ(rc, 0) << "Failed to initialize transfer engine";
|
||||
if (rc != 0) {
|
||||
LOG(ERROR) << "Failed to initialize transfer engine, rc=" << rc;
|
||||
return ErrorCode::INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
Transport* transport = nullptr;
|
||||
if (protocol == "rdma") {
|
||||
|
|
|
|||
|
|
@ -509,6 +509,11 @@ std::optional<TransferFuture> TransferSubmitter::submitTransferEngineOperation(
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (batch_id == Transport::INVALID_BATCH_ID) {
|
||||
LOG(ERROR) << "Invalid batch ID for transfer engine operation";
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
// Create state with transfer engine context - no polling thread
|
||||
// needed
|
||||
auto state = std::make_shared<TransferEngineOperationState>(
|
||||
|
|
|
|||
Loading…
Reference in New Issue