You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by JoshRosen <gi...@git.apache.org> on 2014/10/08 23:35:45 UTC

[GitHub] spark pull request: [SPARK-3741] Make ConnectionManager propagate ...

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

    https://github.com/apache/spark/pull/2593#discussion_r18614120
  
    --- Diff: core/src/main/scala/org/apache/spark/network/nio/Connection.scala ---
    @@ -134,20 +137,24 @@ abstract class Connection(val channel: SocketChannel, val selector: Selector,
         onCloseCallback = callback
       }
     
    -  def onException(callback: (Connection, Exception) => Unit) {
    -    onExceptionCallback = callback
    +  def onException(callback: (Connection, Throwable) => Unit) {
    +    onExceptionCallbacks.add(callback)
       }
     
       def onKeyInterestChange(callback: (Connection, Int) => Unit) {
         onKeyInterestChangeCallback = callback
       }
     
    -  def callOnExceptionCallback(e: Exception) {
    -    if (onExceptionCallback != null) {
    -      onExceptionCallback(this, e)
    -    } else {
    -      logError("Error in connection to " + getRemoteConnectionManagerId() +
    -        " and OnExceptionCallback not registered", e)
    +  def callOnExceptionCallback(e: Throwable) {
    +    onExceptionCallbacks foreach {
    +      callback =>
    +        try {
    +          callback(this, e)
    +        } catch {
    +          case NonFatal(e) => {
    +            logWarning("Ignore error", e)
    --- End diff --
    
    Could you change this to be more descriptive?  How about something like "Ignored error in onExceptionCallback"?


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

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