scwhittle commented on a change in pull request #14458:
URL: https://github.com/apache/beam/pull/14458#discussion_r610032672
##########
File path:
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/data/QueueingBeamFnDataClient.java
##########
@@ -141,6 +138,11 @@ public void drainAndBlock() throws Exception {
return this.mainClient.send(apiServiceDescriptor, outputLocation, coder);
}
+ /** Resets this object so that it may be reused. */
+ public void reset() {
+ inboundDataClients.clear();
Review comment:
I was thinking it was safe since it we won't be in drainAndBlock at this
point.
However I think you're right that there are bugs if any of the
inboundDataClients are not complete and may still append to the queue. This
seems like it could happen if in drainAndComplete we fail inboundClients, but
they still could be adding to the queue.
So priori to and with this cl there is a bug in reusing this object due to
previous clients adding to the queue as it is used for another bundle :(
Trying to coordinate shutdown on reset seems more complicated than just
recreating this object instead of reusing it. What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]