m-trieu commented on code in PR #32566:
URL: https://github.com/apache/beam/pull/32566#discussion_r1776105965


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/streaming/ComputationWorkExecutor.java:
##########
@@ -83,11 +83,11 @@ public final void executeWork(
    * cannot be reused.
    */
   public final void invalidate() {
-    context().invalidateCache();
     try {
+      context().invalidateCache();

Review Comment:
   Discussed over chat.
   Safe because:
   - logic on invalidate cache will not run if work is null
   - Only 1 thread holds a reference to ComputationWorkExecutor and the only 
way it can be reused by another thread is if it is released to 
ComputationState.  If an exception is thrown during processing, the 
ComputationWorkExecutor will not be reused and the reference freed.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to