Example #1
0
void replica::response_client_message(message_ptr& request, error_code error, decree d/* = invalid_decree*/)
{
    if (nullptr == request)
        return;

    message_ptr resp = request->create_response();
    int err = error.get();
    resp->writer().write(err);

    dassert(error != ERR_SUCCESS, "");
    dinfo("handle replication request with rpc_id = %016llx failed, err = %s",
        request->header().rpc_id, error.to_string());

    rpc::reply(resp);
}
Example #2
0
void disk_engine::complete_io(aio_task_ptr& aio, error_code err, uint32_t bytes, int delay_milliseconds)
{
    // TODO: failure injection, profiling, throttling

    if (err != ERR_OK)
    {
        dwarn(
                    "disk operation failure with code %s, err = 0x%x, aio task id = %llx",
                    aio->spec().name,
                    err.get(),
                    aio->id()
                    );
    }
    
    {
        auto_lock<::dsn::utils::ex_lock_nr> l(_lock);
        _request_count--;
    }
    
    aio->enqueue(err, bytes, _node);
    aio->release_ref();
}