add shutdown and start mechanics to windmill streams
Start and closing Windmill streams are currently via halfClose() and on stream creation. Implementations were previously created and returned in a "started" state usually after the stream has already sent the initial headers to open the connection to the backend servers.
Starting in the current state prevents us from being able to start the stream "lazily". And closing allows other blocking stream operations to prevent streams from being able to be closed (stalling at times up to 10-20 minutes).
- Add start() flexibility to the WindmillStream API by allowing external callers to start the stream themselves.
- Add shutdown() capability to allow the stream to receive a shutdown signal, that is idempotent and does not block (or is blocked by) other blocking stream operations.
This is especially important in direct path mode where the user worker manages the fan out to the backend.
in terms of implementation, similar to WindmillStream.shutdown(), WindmillStream.start()'s behavior will only execute once during the lifetime of the WindmillStream object. Subsequent calls to start() and shutdown() will do nothing.
R: @arunpandianp @scwhittle
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
- [ ] 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, commentfixes #<ISSUE NUMBER>instead. - [ ] Update
CHANGES.mdwith 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)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers
assign set of reviewers
Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:
R: @damccorm added as fallback since no labels match configuration
Available commands:
stop reviewer notifications- opt out of the automated review toolingremind me after tests pass- tag the comment author after tests passwaiting 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).
back to you @arunpandianp Thanks!
back to you @arunpandianp thanks!
back to you @arunpandianp @scwhittle thanks!
Run Java Precommit
failures seem to be unrelated
Back to you! Thanks
@arunpandianp @scwhittle
Like how there was a race between populating pending maps and shutdown, I think there is a race between mutating/accessing batches and shutdown in GrpcGetDataStream. Other pieces look okay to me.
@arunpandianp @scwhittle back to you thanks!
Done back to you @arunpandianp Thanks!
Run Java Precommit
back to you @scwhittle @arunpandianp thanks!
back to you @arunpandianp @scwhittle thanks
back to you thanks @scwhittle
back to you @scwhittle thank you!
still need to add some more tests to DirectStreamObserverTest
addressed the other comments
thanks! @scwhittle
back to you @scwhittle thanks!
GrpcGetDataStreamTest.java fails due to a second test added to the test suite:
java.io.IOException: name already registered: Fake server for GrpcGetDataStreamTest
at io.grpc.inprocess.InProcessServer.registerInstance(InProcessServer.java:89)
at io.grpc.inprocess.InProcessServer.start(InProcessServer.java:80)
at io.grpc.internal.ServerImpl.start(ServerImpl.java:185)
at io.grpc.internal.ServerImpl.start(ServerImpl.java:94)
at org.apache.beam.runners.dataflow.worker.windmill.client.grpc.GrpcGetDataStreamTest.setUp(GrpcGetDataStreamTest.java:80)
even though the naming fix, it still failed in internal import