You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@reef.apache.org by we...@apache.org on 2017/07/25 04:25:31 UTC

reef git commit: [REEF-1585] Fix CoreCLR issues in Org.Apache.REEF.IMRU

Repository: reef
Updated Branches:
  refs/heads/master 33a96c17d -> 6a087780e


[REEF-1585] Fix CoreCLR issues in Org.Apache.REEF.IMRU

This addressed the issue by
  * Changing all uses of RemotingException references to standard error classes
  * Doing the same in all other solutions that interact with Org.Apache.REEF.IMRU

JIRA:
  [REEF-1585](https://issues.apache.org/jira/browse/REEF-1585)

Pull request:
  This closes #1339


Project: http://git-wip-us.apache.org/repos/asf/reef/repo
Commit: http://git-wip-us.apache.org/repos/asf/reef/commit/6a087780
Tree: http://git-wip-us.apache.org/repos/asf/reef/tree/6a087780
Diff: http://git-wip-us.apache.org/repos/asf/reef/diff/6a087780

Branch: refs/heads/master
Commit: 6a087780e3a72af6648f9af0ed6641b3229e063a
Parents: 33a96c1
Author: roganc <ro...@microsoft.com>
Authored: Thu Jul 20 16:16:58 2017 -0700
Committer: Markus Weimer <we...@apache.org>
Committed: Mon Jul 24 21:24:18 2017 -0700

----------------------------------------------------------------------
 .../Exceptions/RecoverableNetworkException.cs   | 47 ++++++++++++++++++++
 .../Org.Apache.REEF.Common.csproj               |  5 ++-
 .../OnREEF/IMRUTasks/TaskHostBase.cs            |  4 +-
 .../Group/Task/Impl/OperatorTopology.cs         |  4 +-
 .../NetworkService/NsConnection.cs              |  4 +-
 5 files changed, 56 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/reef/blob/6a087780/lang/cs/Org.Apache.REEF.Common/Exceptions/RecoverableNetworkException.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Exceptions/RecoverableNetworkException.cs b/lang/cs/Org.Apache.REEF.Common/Exceptions/RecoverableNetworkException.cs
new file mode 100644
index 0000000..d3710a9
--- /dev/null
+++ b/lang/cs/Org.Apache.REEF.Common/Exceptions/RecoverableNetworkException.cs
@@ -0,0 +1,47 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+// 
+//   http://www.apache.org/licenses/LICENSE-2.0
+// 
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+using System;
+using System.Runtime.Serialization;
+
+namespace Org.Apache.REEF.Common.Exceptions
+{
+    /// <summary>
+    /// Encapsulates <see cref="Exception#ToString"/> for an Exception related to 
+    /// the Network that can be recovered from.
+    /// </summary>
+    [Serializable]
+    public sealed class RecoverableNetworkException : Exception
+    {
+        public RecoverableNetworkException()
+        {
+        }
+
+        public RecoverableNetworkException(string message) : base(message)
+        {
+        }
+
+        public RecoverableNetworkException(string message, Exception inner) : base(message, inner)
+        {
+        }
+
+        public RecoverableNetworkException(SerializationInfo info, StreamingContext context)
+            : base(info, context)
+        {
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/reef/blob/6a087780/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj b/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj
index 4bbab06..518bdfb 100644
--- a/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj
+++ b/lang/cs/Org.Apache.REEF.Common/Org.Apache.REEF.Common.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
@@ -109,6 +109,7 @@ under the License.
     <Compile Include="Events\IContextStart.cs" />
     <Compile Include="Events\IContextStop.cs" />
     <Compile Include="Exceptions\JobException.cs" />
+    <Compile Include="Exceptions\RecoverableNetworkException.cs" />
     <Compile Include="Exceptions\NonSerializableEvaluatorException.cs" />
     <Compile Include="Exceptions\NonSerializableTaskException.cs" />
     <Compile Include="Files\PathUtilities.cs" />
@@ -289,4 +290,4 @@ under the License.
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
   <Import Project="$(PackagesDir)\StyleCop.MSBuild.$(StyleCopVersion)\build\StyleCop.MSBuild.Targets" Condition="Exists('$(PackagesDir)\StyleCop.MSBuild.$(StyleCopVersion)\build\StyleCop.MSBuild.Targets')" />
-</Project>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/reef/blob/6a087780/lang/cs/Org.Apache.REEF.IMRU/OnREEF/IMRUTasks/TaskHostBase.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/IMRUTasks/TaskHostBase.cs b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/IMRUTasks/TaskHostBase.cs
index 1bf1ff4..ae48068 100644
--- a/lang/cs/Org.Apache.REEF.IMRU/OnREEF/IMRUTasks/TaskHostBase.cs
+++ b/lang/cs/Org.Apache.REEF.IMRU/OnREEF/IMRUTasks/TaskHostBase.cs
@@ -18,8 +18,8 @@
 using System;
 using System.IO;
 using System.Net.Sockets;
-using System.Runtime.Remoting;
 using System.Threading;
+using Org.Apache.REEF.Common.Exceptions;
 using Org.Apache.REEF.Common.Runtime;
 using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Common.Tasks.Events;
@@ -128,7 +128,7 @@ namespace Org.Apache.REEF.IMRU.OnREEF.IMRUTasks
         private static bool IsCommunicationException(Exception e)
         {
             if (e is OperationCanceledException || e is IOException || e is TcpClientConnectionException ||
-                e is RemotingException || e is SocketException ||
+                e is RecoverableNetworkException || e is SocketException ||
                 (e is AggregateException && e.InnerException != null && e.InnerException is IOException))
             {
                 return true;

http://git-wip-us.apache.org/repos/asf/reef/blob/6a087780/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/OperatorTopology.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/OperatorTopology.cs b/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/OperatorTopology.cs
index 357b4d5..6d7aa18 100644
--- a/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/OperatorTopology.cs
+++ b/lang/cs/Org.Apache.REEF.Network/Group/Task/Impl/OperatorTopology.cs
@@ -18,8 +18,8 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
-using System.Runtime.Remoting;
 using System.Threading;
+using Org.Apache.REEF.Common.Exceptions;
 using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Common.Tasks;
 using Org.Apache.REEF.Network.Group.Config;
@@ -393,7 +393,7 @@ namespace Org.Apache.REEF.Network.Group.Task.Impl
 
                 var leftOver = string.Join(",", identifiers.Where(e => !foundList.Contains(e)));
                 Logger.Log(Level.Error, "For node {0}, cannot find registered parent/children: {1}.", _selfId, leftOver);
-                Exceptions.Throw(new RemotingException("Failed to find parent/children nodes in operator topology for node: " + _selfId), Logger);
+                Exceptions.Throw(new RecoverableNetworkException("Failed to find parent/children nodes in operator topology for node: " + _selfId), Logger);
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/reef/blob/6a087780/lang/cs/Org.Apache.REEF.Network/NetworkService/NsConnection.cs
----------------------------------------------------------------------
diff --git a/lang/cs/Org.Apache.REEF.Network/NetworkService/NsConnection.cs b/lang/cs/Org.Apache.REEF.Network/NetworkService/NsConnection.cs
index 062f185..6355ed5 100644
--- a/lang/cs/Org.Apache.REEF.Network/NetworkService/NsConnection.cs
+++ b/lang/cs/Org.Apache.REEF.Network/NetworkService/NsConnection.cs
@@ -20,7 +20,7 @@ using System.Collections.Generic;
 using System.IO;
 using System.Net;
 using System.Net.Sockets;
-using System.Runtime.Remoting;
+using Org.Apache.REEF.Common.Exceptions;
 using Org.Apache.REEF.Common.Io;
 using Org.Apache.REEF.Tang.Exceptions;
 using Org.Apache.REEF.Utilities.Logging;
@@ -77,7 +77,7 @@ namespace Org.Apache.REEF.Network.NetworkService
             IPEndPoint destAddr = _nameClient.CacheLookup(_destId.ToString());
             if (destAddr == null)
             {
-                throw new RemotingException("Cannot register Identifier with NameService");
+                throw new RecoverableNetworkException("Cannot register Identifier with NameService");
             }
 
             try