Fix process enumeration when there are stale sockets in the temp folder (#2034)
authorWiktor Kopec <wiktork@microsoft.com>
Mon, 1 Mar 2021 21:47:26 +0000 (13:47 -0800)
committerGitHub <noreply@github.com>
Mon, 1 Mar 2021 21:47:26 +0000 (13:47 -0800)
src/Microsoft.Diagnostics.Monitoring/ClientEndpointInfoSource.cs

index 7160127b477b5d5ab6431f30d742baa7194301a2..7cac048cb35e31e90ca1f77150dc3da295193534 100644 (file)
@@ -32,6 +32,11 @@ namespace Microsoft.Diagnostics.Monitoring
                     {
                         return null;
                     }
+                    //Most errors from IpcTransport, such as a stale socket.
+                    catch (ServerNotAvailableException)
+                    {
+                        return null;
+                    }
                 }, token));
             }