microsoft / FluidFramework

Library for building distributed, real-time collaborative web applications
https://fluidframework.com
MIT License
4.7k stars 528 forks source link

[GC] Removed unreferenced event queue and unreferenced events are logged only for non-revived objects #21916

Closed agarwal-navin closed 1 month ago

agarwal-navin commented 1 month ago

In summarizer clients, unreferenced events (inactive, tombstone ready and sweep ready) are added to a queue and are logged after the next GC completes. This was done to reduce false positives in 2 scenarios:

With the reference op work, both of these problems don't exist. So, we can remove the unreferenced event queue for summarizer clients. Also, we can check that an object is not revived before we log an event for it which will reduce false positives for non-summarizer clients too.

This PR makes 3 main changes:

  1. It removes the unreferenced event queue for summarizers and logs unreferenced events right away.
  2. It checks that GC did not see a reference for an unreferenced object before it was used. If it did, it does not log because the usage isn't unexpected.
  3. Added packagePath and fromPackagePath properties to addedGCOutboundRoute. Since this information is already present with the runtime when it calls GC, it doesn't need to ask for it.

AB#8938

msfluid-bot commented 1 month ago
@fluid-example/bundle-size-tests: -856 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 457.46 KB 457.23 KB -240 Bytes
azureClient.js 555.23 KB 555.01 KB -226 Bytes
connectionState.js 680 Bytes 680 Bytes No change
containerRuntime.js 258.67 KB 258.42 KB -262 Bytes
fluidFramework.js 405.94 KB 405.95 KB +14 Bytes
loader.js 134.04 KB 134.05 KB +14 Bytes
map.js 42.13 KB 42.14 KB +7 Bytes
matrix.js 145.61 KB 145.62 KB +7 Bytes
odspClient.js 523.37 KB 523.15 KB -226 Bytes
odspDriver.js 97.55 KB 97.57 KB +21 Bytes
odspPrefetchSnapshot.js 42.61 KB 42.62 KB +14 Bytes
sharedString.js 162.62 KB 162.63 KB +7 Bytes
sharedTree.js 396.45 KB 396.46 KB +7 Bytes
Total Size 3.3 MB 3.29 MB -856 Bytes

Baseline commit: bfbef34ed3db0ed08b03ecdb1de31a3b948fbcdd

Generated by :no_entry_sign: dangerJS against eb4713a2a0680a3be4ec2c5cd26cf75727a692e0

azure-boards[bot] commented 1 month ago

✅ Successfully linked to Azure Boards work item(s):