Buffer sending of large manifests
authorDavid Mason <davmason@microsoft.com>
Mon, 11 Apr 2016 20:41:29 +0000 (13:41 -0700)
committerDavid Mason <davmason@microsoft.com>
Mon, 11 Apr 2016 22:37:57 +0000 (15:37 -0700)
Commit migrated from https://github.com/dotnet/coreclr/commit/9481107ec19da27c677434c32e827803d894174d

src/coreclr/src/mscorlib/src/System/Diagnostics/Eventing/EventSource.cs

index 218826a..73b23bc 100644 (file)
@@ -3153,6 +3153,11 @@ namespace System.Diagnostics.Tracing
                     dataLeft -= chunkSize;
                     dataDescrs[1].Ptr += (uint)chunkSize;
                     envelope.ChunkNumber++;
+                    
+                    // For large manifests we want to not overflow any receiver's buffer. Most manifests will fit within
+                    // 5 chunks, so only the largest manifests will hit the pause.
+                    if((envelope.ChunkNumber % 5) == 0)
+                        Thread.Sleep(15);
                 }
             }
 #endif // FEATURE_MANAGED_ETW