Skip to content

Conversation

@youngoli
Copy link
Contributor

@youngoli youngoli commented Apr 5, 2022

  • [BEAM-13519] Solve race issues when the server responds with an error before the GrpcStateClient finishes.

The issue was that the InboundObserver can be invoked before outboundObserverFactory#outboundObserverFor returns meaning that
the server is waiting for a response for cache.remove but cache.computeIfAbsent is being invoked at the same time.

Another issue was that the outstandingRequests map could be updated with another request within GrpcStateClient during closeAndCleanup meaning that the CompleteableFuture would never be completed exceptionally.

Passes 1000 times locally now without getting stuck or failing.

(cherry picked from commit 0262ee5)


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

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • 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

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

… before the GrpcStateClient finishes being constructed. (apache#17240)

* [BEAM-13519] Solve race issues when the server responds with an error before the GrpcStateClient finishes.

The issue was that the InboundObserver can be invoked before outboundObserverFactory#outboundObserverFor returns meaning that
the server is waiting for a response for cache.remove but cache.computeIfAbsent is being invoked at the same time.

Another issue was that the outstandingRequests map could be updated with another request within GrpcStateClient during closeAndCleanup meaning that the CompleteableFuture would never be completed exceptionally.

Passes 1000 times locally now without getting stuck or failing.

(cherry picked from commit 0262ee5)
@github-actions github-actions bot added the java label Apr 5, 2022
@youngoli
Copy link
Contributor Author

youngoli commented Apr 5, 2022

R: @lukecwik @TheNeuralBit

This fixes the race condition causing failures in Java Precommit.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants