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

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

Github user uce commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2690#discussion_r85299971
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/writer/RecordWriter.java
 ---
    @@ -108,15 +108,25 @@ private void sendToTarget(T record, int 
targetChannel) throws IOException, Inter
     
                synchronized (serializer) {
                        SerializationResult result = 
serializer.addRecord(record);
    +
                        while (result.isFullBuffer()) {
                                Buffer buffer = serializer.getCurrentBuffer();
     
                                if (buffer != null) {
    -                                   writeBuffer(buffer, targetChannel, 
serializer);
    +                                   writeAndClearBuffer(buffer, 
targetChannel, serializer);
    +
    +                                   // If this was a full record, we are 
done. Not breaking
    +                                   // out of the loop at this point will 
lead to another
    +                                   // buffer request before breaking out 
(that would not be
    +                                   // a problem per se, but it can lead to 
stalls in the
    +                                   // pipeline).
    +                                   if (result.isFullRecord()) {
    +                                           break;
    --- End diff --
    
    Yes, exactly.


> Don't block on buffer request after broadcastEvent 
> ---------------------------------------------------
>
>                 Key: FLINK-4894
>                 URL: https://issues.apache.org/jira/browse/FLINK-4894
>             Project: Flink
>          Issue Type: Improvement
>            Reporter: Ufuk Celebi
>            Assignee: Ufuk Celebi
>
> After broadcasting an event (like the checkpoint barrier), the record writer 
> might block on a buffer request although that buffer will only be needed on 
> the next write on that channel.
> Instead of assuming that each serializer has a buffer set, we can change the 
> logic in the writer to request the buffer when it requires one.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to