[ 
https://issues.apache.org/jira/browse/FLINK-10727?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16672880#comment-16672880
 ] 

ASF GitHub Bot commented on FLINK-10727:
----------------------------------------

NicoK commented on issue #6974: [FLINK-10727][network] remove unnecessary 
synchronization in SingleInputGate#requestPartitions()
URL: https://github.com/apache/flink/pull/6974#issuecomment-435335043
 
 
   Hi Till, sorry for missing this one use: there are two options now:
   1) revert the commit, or
   2) make `requestedPartitionsFlag` a volatile (actually, my first attempt 
before this PR)
   
   I'd vote for the second.
   
   FYI: I had two Travis runs of my branch which only failed in some S3 e2e 
test (unrelated) and passed all the others

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Remove unnecessary synchronization in SingleInputGate#requestPartitions()
> -------------------------------------------------------------------------
>
>                 Key: FLINK-10727
>                 URL: https://issues.apache.org/jira/browse/FLINK-10727
>             Project: Flink
>          Issue Type: Improvement
>          Components: Network
>    Affects Versions: 1.5.5, 1.6.2, 1.7.0
>            Reporter: Nico Kruber
>            Assignee: Nico Kruber
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.7.0
>
>
> For every {{SingleInputGate#getNextBufferOrEvent()}}, 
> {{SingleInputGate#requestPartitions()}} is called and this always 
> synchronizes on the {{requestLock}} before checking the 
> {{requestedPartitionsFlag}}. Since {{SingleInputGate#requestPartitions()}} is 
> only called from the same thread (the task thread getting the record), it is 
> enough to check the {{requestedPartitionsFlag}} first before synchronizing 
> for the actual requests (if needed). {{UnionInputGate}} already goes the same 
> way in its {{requestPartitions()}} implementation.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to