Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue 13688][client] Fix send chunking message failed when encryption enabled #13689

Merged
merged 1 commit into from
Jan 18, 2022

Conversation

Jason918
Copy link
Contributor

Fixes #13688

Motivation

See #13688

Modifications

The root cause is that all chunked messages shares the same msgMetadata object.
The EncryptionKeys will be repeated added into message metadata.
And proto buffer objects does not support serialization with bytes value type.

Fix by clearing EncryptionKeys before adding.

Verifying this change

  • Make sure that the change passes the CI checks.

This change added tests and can be verified as follows:

  • org.apache.pulsar.client.api.SimpleProducerConsumerTest#testCryptoWithChunking

Does this pull request potentially affect one of the following parts:

If yes was chosen, please highlight the changes

  • Dependencies (does it add or upgrade a dependency): (no)
  • The public API: (no)
  • The schema: (no)
  • The default values of configurations: (no)
  • The wire protocol: (no)
  • The rest endpoints: (no)
  • The admin cli options: (no)
  • Anything that affects deployment: (no)

Documentation

Check the box below and label this PR (if you have committer privilege).

Need to update docs?

  • no-need-doc
    Bug fix.

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jan 10, 2022
@Jason918
Copy link
Contributor Author

/pulsarbot run-failure-checks

@Jason918
Copy link
Contributor Author

@gaoran10 @MarvinCai @codelipenghui The root cause is similar to the fix with schemaVersion in #12720. PTAL

@codelipenghui codelipenghui added this to the 2.10.0 milestone Jan 12, 2022
@codelipenghui codelipenghui added release/2.9.2 type/bug The PR fixed a bug or issue reported a bug labels Jan 12, 2022
@codelipenghui
Copy link
Contributor

@RobertIndie Please also help review this PR.

@gaoran10 gaoran10 merged commit c1ff87c into apache:master Jan 18, 2022
codelipenghui pushed a commit that referenced this pull request Jan 18, 2022
# Motivation

Fix issue #13688.

Send chunking message failed with `org.apache.pulsar.client.api.PulsarClientException$TimeoutException` when encryption is enabled.

### Modifications

The root cause is that all chunked messages share the same msgMetadata object.
The `EncryptionKeys` will be repeated added into message metadata.
And proto buffer objects do not support serialization with bytes value type.

(cherry picked from commit c1ff87c)
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/client cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-not-needed Your PR changes do not impact docs release/2.9.2 type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send chunking message failed when encryption enabled.
5 participants