Skip to content

[fix][client] retry letter producer respect auto schema#19051

Merged
tisonkun merged 4 commits into
apache:masterfrom
tisonkun:fix-retry-letter-auto-schema
Dec 27, 2022
Merged

[fix][client] retry letter producer respect auto schema#19051
tisonkun merged 4 commits into
apache:masterfrom
tisonkun:fix-retry-letter-auto-schema

Conversation

@tisonkun

@tisonkun tisonkun commented Dec 25, 2022

Copy link
Copy Markdown
Member

Verifying this change

Add a new test testAutoConsumeSchemaRetryLetter.

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

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Matching PR in forked repository

PR in forked repository:

@tisonkun tisonkun self-assigned this Dec 25, 2022
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Dec 25, 2022
@tisonkun tisonkun added this to the 2.12.0 milestone Dec 25, 2022
@tisonkun tisonkun changed the title [fix][broker] retry letter producer respect auto schema [fix][client] retry letter producer respect auto schema Dec 25, 2022
@codecov-commenter

codecov-commenter commented Dec 25, 2022

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.53%. Comparing base (b42aed1) to head (1c507ed).
⚠️ Report is 3071 commits behind head on master.

Files with missing lines Patch % Lines
...va/org/apache/pulsar/client/impl/ConsumerImpl.java 0.00% 10 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #19051      +/-   ##
============================================
+ Coverage     47.11%   47.53%   +0.41%     
- Complexity    10595    10733     +138     
============================================
  Files           710      711       +1     
  Lines         69423    69459      +36     
  Branches       7449     7453       +4     
============================================
+ Hits          32709    33015     +306     
+ Misses        33037    32750     -287     
- Partials       3677     3694      +17     
Flag Coverage Δ
unittests 47.53% <0.00%> (+0.41%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...va/org/apache/pulsar/client/impl/ConsumerImpl.java 15.06% <0.00%> (-0.04%) ⬇️

... and 61 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@congbobo184 congbobo184 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you please make the test simple and specific?


@Cleanup
PulsarClient newPulsarClient = newPulsarClient(lookupUrl.toString(), 0);// Creates new client connection
Consumer<FooV2> deadLetterConsumer = newPulsarClient.newConsumer(Schema.AVRO(FooV2.class))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we should use deadLetterConsumer?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I follow the test pattern from testRetryTopic and testAutoConsumeSchemaDeadLetter. Even testRetryTopic set up the DLQ.

May you directly submit a patch onto this pull request?

.ackTimeout(1, TimeUnit.SECONDS)
.enableRetry(true)
.receiverQueueSize(100)
.deadLetterPolicy(DeadLetterPolicy.builder().maxRedeliverCount(maxRedeliveryCount).build())

@congbobo184 congbobo184 Dec 25, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't need to test dead letter right?

@eolivelli eolivelli left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

This approach is better.

The downside is that auto produce Schema validates the input, that is already validated and we are wadting some resources.

We can follow up with some enhancements

@tisonkun

Copy link
Copy Markdown
Member Author

@congbobo184 I saw your patch and it seems code style check failed now. I'll try to fix it in hours.

@tisonkun

Copy link
Copy Markdown
Member Author

Thank you!

@poorbarcode

Copy link
Copy Markdown
Contributor

Hi @tisonkun

I found that the Files Changed have been dirty, could you deal with it?

截屏2022-12-27 17 44 19

@tisonkun

Copy link
Copy Markdown
Member Author

@poorbarcode aha. It's due to a rebase on merge master commit. I can fix it later.

tisonkun and others added 4 commits December 27, 2022 19:13
Signed-off-by: tison <wander4096@gmail.com>
Co-authored-by: dibulidohu <dibulidohu@tencent.com>
Signed-off-by: tison <wander4096@gmail.com>
Signed-off-by: tison <wander4096@gmail.com>
@tisonkun
tisonkun force-pushed the fix-retry-letter-auto-schema branch from 3764ccb to 1c507ed Compare December 27, 2022 11:13
@tisonkun

tisonkun commented Dec 27, 2022

Copy link
Copy Markdown
Member Author

@poorbarcode updated.

FWIW, the process is:

  1. Rename the local branch to tmp.
  2. Checkout this pull request with gh pr checkout 19051
  3. Reset to a ancient commit and merge master.
  4. Cherry pick the effective commits from tmp (origin this pull request).
  5. Force push.

@tisonkun

tisonkun commented Dec 27, 2022

Copy link
Copy Markdown
Member Author

A weird error: https://github.com/apache/pulsar/actions/runs/3787043645/jobs/6439462375

  Error:  Failed to execute goal org.jacoco:jacoco-maven-plugin:0.8.7:report (post-test) on project pulsar-broker: An error has occurred in JaCoCo report generation. Error while creating report: malformed input around byte 2 -> [Help 1]
  Error:  
  Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
  Error:  Re-run Maven using the -X switch to enable full debug logging.
  Error:  
  Error:  For more information about the errors and possible solutions, please read the following articles:
  Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  Error: Process completed with exit code 1.

I'm trying rerun, but it seems an unexpected error. cc @yaalsn IIRC jacoco report is introduced by you.

@tisonkun

Copy link
Copy Markdown
Member Author

Merging...

@tisonkun
tisonkun merged commit 2877221 into apache:master Dec 27, 2022
@tisonkun
tisonkun deleted the fix-retry-letter-auto-schema branch December 27, 2022 13:53
@yaalsn

yaalsn commented Dec 30, 2022

Copy link
Copy Markdown
Contributor

@tisonkun It seems that it passed after you rerun the job. Did you modify any code before the rerun?

@tisonkun

Copy link
Copy Markdown
Member Author

@yaalsn No.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/client doc-not-needed Your PR changes do not impact docs ready-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retry letter producer does not handle AUTO_CONSUME_SCHEMA

6 participants