pnowojski commented on a change in pull request #10345: [FLINK-12484][runtime] 
synchronize all mailbox actions
URL: https://github.com/apache/flink/pull/10345#discussion_r351859005
 
 

 ##########
 File path: 
flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/tasks/mailbox/MailboxExecutorImpl.java
 ##########
 @@ -37,9 +39,12 @@
 
        private final int priority;
 
-       public MailboxExecutorImpl(@Nonnull TaskMailbox mailbox, int priority) {
+       public final ExecutionDecorator executionDecorator;
+
+       public MailboxExecutorImpl(@Nonnull TaskMailbox mailbox, int priority, 
ExecutionDecorator executionDecorator) {
 
 Review comment:
   maybe instead of wrapping every `#run()` with the decorator, we could provide
   ```
   public class DecoratedMail extends Mail {
     private final ExecutionDecorator executionDecorator;
     (...)
     @Override
     public void run() {
       executionDecorator.runThrowing(super::run);
     }
   }
   ```
   ? After all `Mail` is constructed only in two places in the 
`MailboxExecutorImpl`, which could be deduplicated into a single `Mail 
MailboxExecutorImpl#createMail(...)`. From here we could either ad `if` check 
inside this method that would created `DecoratedMail` or `Mail`, or introduce 
`DecoratedMailboxExecutor` which would override this method? (independent 
`DecoratedMailboxExecutor` would ensure no extra overheads when not using 
checkpoint lock)
   
   As it is now, it's a bit fragile to remember that any mail execution should 
happen with using `executionDecorator`. 

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


With regards,
Apache Git Services

Reply via email to