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

    https://github.com/apache/spark/pull/5234#discussion_r27448410
  
    --- Diff: 
network/common/src/main/java/org/apache/spark/network/protocol/MessageEncoder.java
 ---
    @@ -72,9 +80,84 @@ public void encode(ChannelHandlerContext ctx, Message 
in, List<Object> out) {
         in.encode(header);
         assert header.writableBytes() == 0;
     
    -    out.add(header);
         if (body != null && bodyLength > 0) {
    -      out.add(body);
    +      out.add(new MessageWithHeader(header, headerLength, body, 
bodyLength));
    +    } else {
    +      out.add(header);
         }
       }
    +
    +  /**
    +   * A wrapper message that holds two separate pieces (a header and a 
body) to avoid
    +   * copying the body's content.
    +   */
    +  private static class MessageWithHeader extends AbstractReferenceCounted 
implements FileRegion {
    --- End diff --
    
    @rxin Doesn't this mean epoll will never work? Today, one could disable 
lazy file region, but this is no longer an option.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to