Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Apr 1, 2024. It is now read-only.
This repository was archived by the owner on Apr 1, 2024. It is now read-only.

ISSUE-17188: [feature request] C++ and Python support include message header size when check maxMessageSize. #4765

@sijie

Description

@sijie

Original Issue: apache#17188


Search before asking

  • I searched in the issues and found nothing similar.

Motivation

PIP 132 Include message header size when check maxMessageSize for non-batch message on the client side

Current c++ the implementation also has this problem.

    const bool compressed = !canAddToBatch(msg);
    const auto payload =
        compressed ? applyCompression(uncompressedPayload, conf_.getCompressionType()) : uncompressedPayload;
    const auto compressedSize = static_cast<uint32_t>(payload.readableBytes());
    const auto maxMessageSize = static_cast<uint32_t>(ClientConnection::getMaxMessageSize());

    if (compressed && compressedSize > ClientConnection::getMaxMessageSize() && !chunkingEnabled_) {
        LOG_WARN(getName() << " - compressed Message payload size " << payload.readableBytes()
                           << " cannot exceed " << ClientConnection::getMaxMessageSize()
                           << " bytes unless chunking is enabled");
        handleFailedResult(ResultMessageTooBig);
        return;
    }

Solution

Refer java client PR: apache#14007

Alternatives

No response

Anything else?

This is a PR to match the Java implementation. It is best to first prove whether the problem exists in the C++ client, and then solve it.

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions