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

    https://github.com/apache/spark/pull/1632#discussion_r16153410
  
    --- Diff: 
core/src/main/scala/org/apache/spark/network/ConnectionManager.scala ---
    @@ -652,19 +655,25 @@ private[spark] class ConnectionManager(
               }
             }
             if (bufferMessage.hasAckId()) {
    -          val sentMessageStatus = messageStatuses.synchronized {
    +          messageStatuses.synchronized {
                 messageStatuses.get(bufferMessage.ackId) match {
                   case Some(status) => {
                     messageStatuses -= bufferMessage.ackId
    -                status
    +                status.markDone(Some(message))
                   }
                   case None => {
    -                throw new Exception("Could not find reference for received 
ack message " +
    -                  message.id)
    +                /**
    +                 * If isAckTimeout == true, Future returned from 
sendMessageReliably should fail
    +                 * and finally, FetchFailedException is thrown so in this 
case, we don't need
    +                 * to throw Exception here
    +                 */
    +                if (!isAckTimeout) {
    --- End diff --
    
    ------------------ 原始邮件 ------------------
      发件人: "Josh Rosen";<notificati...@github.com>;
     发送时间: 2014年8月12日(星期二) 中午12:24
     收件人: "apache/spark"<sp...@noreply.github.com>; 
     
     主题: Re: [spark] [SPARK-2677] BasicBlockFetchIterator#next can 
waitforever (#1632)
    
     
    
     
    In core/src/main/scala/org/apache/spark/network/ConnectionManager.scala:
    >                } >                case None => { > -                throw 
new Exception("Could not find reference for received ack message " + > -        
          message.id) > +                /** > +                 * If 
isAckTimeout == true, Future returned from sendMessageReliably should fail > +  
               * and finally, FetchFailedException is thrown so in this case, 
we don't need > +                 * to throw Exception here > +                 
*/ > +                if (!isAckTimeout) {  
    Since we delete the MessageStatuses of messages that fail with timeouts, I 
guess we have no way to distinguish between an ACK for a message that we didn't 
send and an ACK for a timed-out message. I guess that isAckTimeout is used to 
strike a reasonable compromise in which we'll detect errors if no timeouts 
occur.
     
    It might be a good idea to logWarning if we receive an ACK after we've 
timed out; this might help when debugging: if the ack timeout is set too low, 
warning messages would appear in the logs.
     
    —
    Reply to this email directly or view it on GitHub.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to