blackdrag commented on PR #3259:
URL: https://github.com/apache/groovy/pull/3259#issuecomment-6926275156

   for me the biggest problems are resolved. There is one issue for later 
though:
   ```Java
   writeLock.lock();
   try {
       // ...
       boolean more = upstream.tryAdvance(item -> {
           replay.add(item);
           advanced[0] = true;
       });
   
       // ...
       action.accept(replay.get(cursor++));
       return true;
   } finally {
       writeLock.unlock();
   }
   ```
   I think you are basically doing the above when pulling new elements. That 
means the action is executed under write lock. And the cursor is only increased 
as part of the action call. What happens if there is an exception in the code 
in between? Maybe you should also think if you can test the concurrency 
scenario with multiple reader and writer.
   But as I said, that is in my opinion something that can still be done in a 
follow-up issue.


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