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

Io jms fix ack message checkpoint #22932

Merged
merged 25 commits into from
Oct 19, 2022

Conversation

rvballada
Copy link
Contributor

@rvballada rvballada commented Aug 29, 2022

Hi @lukecwik would you kindly review this PR related to the following issue:
#20814

Please find the following design documentation:
https://docs.google.com/document/d/19HiNPoJeIlzCFyWGdlw7WEFutceL2AmN_5Z0Vmi1s-I/edit?usp=sharing
assign to next reviewer:
R: @lukecwik


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • [ X] Choose reviewer(s) and mention them in a comment (R: @username).
  • [ X] Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • [ X] Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@github-actions
Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @lukecwik for label java.
R: @chamikaramj for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

@github-actions
Copy link
Contributor

github-actions bot commented Sep 6, 2022

Reminder, please take a look at this pr: @lukecwik @chamikaramj

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2022

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @apilloud for label java.
R: @johnjcasey for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

@github-actions
Copy link
Contributor

Reminder, please take a look at this pr: @apilloud @johnjcasey

@github-actions
Copy link
Contributor

Assigning new set of reviewers because Pr has gone too long without review. If you would like to opt out of this review, comment assign to next reviewer:

R: @kileys for label java.
R: @pabloem for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

- Upgrade equals and hashcode method in JmsCheckpointMark
- Add a serciveExecutor.schedule method in order to close the JMS session after a tiemout and discard all the related checkpointd
- Get back to the initial implementation of JmsCheckpointMark
- Add the discard attribute and discard() method to JmsCheckpointMark
@lukecwik
Copy link
Member

Sorry for the long wait, lots of other issues blocked me from reviewing this. Taking a follow-up look now.

Copy link
Member

@lukecwik lukecwik left a comment

Choose a reason for hiding this comment

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

All my comments are minor other then improving how we author the testCloseWithTimeout so it isn't reliant on Thread.sleep

JmsIO.UnboundedJmsReader reader = source.createReader(null, null);

reader.start();
reader.close();
Copy link
Member

Choose a reason for hiding this comment

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

I would suggest using a mock ScheduledExecutorService that you set on the PipelineOptions object when creating the reader. This way you can inject here in the test and capture the runnable/callable directly without needing to have a test reliant on Thread.sleep

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do we get the executor service from ExecutorOptions? As far as I can see, PipelineOptions should be then a reader field, but how do we get the ExecutorService from PipelineOptions?

Copy link
Member

Choose a reason for hiding this comment

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

pipelineOptions.as(ExecutorOptions.class).getScheduledExecutorService(), the key part being the as(...) method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I get it. I don't know exactly how to mock it.

@lukecwik
Copy link
Member

#23234 was merged allowing you to use the ScheduledExecutorService from PipelineOptions

consumer = null;
closeAutoscaler();
closeConsumer();
ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor();
Copy link
Member

Choose a reason for hiding this comment

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

pipelineOptions.as(ExecutorOptions.class).getScheduledExecutorService(), the key part being the as(...) method

@lukecwik
Copy link
Member

Note that the next release cut is this Wednesday so if your able to clean-up this PR we could merge it and it would make its way into the 2.43 release otherwise it will be another 6 weeks before the next release cut.

rvballada and others added 5 commits October 18, 2022 08:47
Co-authored-by: Lukasz Cwik <lcwik@google.com>
Co-authored-by: Lukasz Cwik <lcwik@google.com>
Co-authored-by: Lukasz Cwik <lcwik@google.com>
Copy link
Member

@lukecwik lukecwik left a comment

Choose a reason for hiding this comment

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

I'll try updating the test to use a mock.

@lukecwik
Copy link
Member

Updated to use a mock, now waiting for results of test run before merging.

@lukecwik
Copy link
Member

Run Java PreCommit

@lukecwik lukecwik merged commit 10977bf into apache:master Oct 19, 2022
@rvballada
Copy link
Contributor Author

Thanks @lukecwik !

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

Successfully merging this pull request may close these issues.

3 participants