[fix][client] Java Client's Seek Logic Not Threadsafe #1#20242
[fix][client] Java Client's Seek Logic Not Threadsafe #1#20242tisonkun merged 6 commits intoapache:masterfrom JooHyukKim:19671-consumerimpl-compare-and-set
Conversation
|
Could you add a test for your changes? |
Sure! Will do in bit. Can I ask for your opinion, @nodece ? Do you think we should...
Because since the change is made in a private method I am trying to test through either of two methods, but I have not succeeded in finding a test I can refer to except below test from broker seems to cover too much. |
tisonkun
left a comment
There was a problem hiding this comment.
Shall we set:
MessageIdAdv originSeekMessageId = seekMessageId;
seekMessageId = (MessageIdAdv) seekId;
after the check passed?
|
@JooHyukKim BTW, edit comment won't send notification, I suggest you create new comment when you'd like to notify reviewers. |
|
I'd appreciate it if you can provide a timing diagram to prove the fix. You may refer to apache/curator#430 as a typical description. |
|
How to verify your changes? You can set |
Right, thank you for the reminder 👍🏻 |
Np 👍🏻. May I ask what tool everyone conventionally uses? Or your suggestion @tisonkun ? |
Generally, I just write in text :D It's about:
But any tool you searched is acceptable as long as the diagram is clear (with text, reviewers manually dump to diagram). |
tisonkun
left a comment
There was a problem hiding this comment.
Wait a bit for review from @michaeljmarshall.
This patch looks good to me.
Thank you for the tips! |
|
@JooHyukKim Please fix style violation by yourself. You can use CI workflow in your personal fork to verify. Or the command should be: Ping me once CI passed in your personal fork. |
|
/pulsarbot rerun-failure-checks |
|
Thank you @tisonkun, I made below two check style commands pass, "locally". My personal fork is not running CI. Is it supposed to run though? 🤔🤔
|
Yes. You may take lhotari#145 as an example. IIRC GitHub sometimes stuck on turning on Actions..I don't have too much suggestions here but I used to follow the instructions in Actions tab to add a sample workflow and then GitHub turn on Actions. |
|
/pulsarbot rerun-failure-checks |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20242 +/- ##
============================================
- Coverage 72.87% 72.86% -0.02%
+ Complexity 31943 3601 -28342
============================================
Files 1868 1868
Lines 138594 138597 +3
Branches 15246 15247 +1
============================================
- Hits 101003 100991 -12
- Misses 29547 29557 +10
- Partials 8044 8049 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Merging... Thanks for your contribution! |
|
@JooHyukKim May I ask what |
Oh... 😅 "#1" means My first ever contribution to Pulsar! I can remove the "#1" part from title if you think it will confuse the maintenance team. Just let me know~ 🙏🏼 @tisonkun
@tisonkun Thank you for great guidance on your part 🙏🏼 |
|
Never mind. I can edit the commit message before merging :D |
michaeljmarshall
left a comment
There was a problem hiding this comment.
Thanks for your contribution @JooHyukKim! Would you mind updating the Javadoc for the seek and seekAsync methods to indicate what will happen if a user calls a seek method before a previous call completes? Here is a reference to one of the Javadocs:
Will do! 🙏🏽 Later after work 😀 |
|
@tisonkun |
|
@Technoboy- Thanks for setting up the milestone.
Yep. I'm investigating some tools to unify whitespace so that we don't ask for aligning again and again. |
This reverts commit bc1764f.
(cherry picked from commit bc1764f)
Fixes #19671
Motivation
To resolve the thread-safety issue around Java client's seek logic identified by #19671.
Modifications
duringSeekflag is not false.Verifying this change
I am not sure if my PR went through the intended CI checks...?
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: https://github.com/JooHyukKim/pulsar/pull/1