Open ktoso opened 4 years ago
Implemented an actor leak detector:
Test Case '-[DistributedActorsTests.ClusterDiscoveryTests test_discovery_shouldInitiateJoinsToNewlyDiscoveredNodes]' started.
DistributedActorsTestKit/ClusterSystemXCTestCase.swift:60: Fatal error: !!!!!! DETECTED LEAKED ACTORS: 3 !!!!
BEFORE ============================================
NOW ===============================================
DistributedActors.OpLogDistributedReceptionist
- count: 1
- ids: ["0x11f70f380"]
DistributedActors.ClusterEventStreamActor
- count: 1
- ids: ["0x1281089e0"]
DistributedActors.ClusterControl.(MembershipHolder in _1E7381868A8BFB9E946FBA4168BEE1E3)
- count: 1
- ids: ["0x600003cc0180"]
DIFF ==============================================
DistributedActors.OpLogDistributedReceptionist
- count: 1
- ids: ["0x11f70f380"]
DistributedActors.ClusterEventStreamActor
- count: 1
- ids: ["0x1281089e0"]
DistributedActors.ClusterControl.(MembershipHolder in _1E7381868A8BFB9E946FBA4168BEE1E3)
- count: 1
- ids: ["0x600003cc0180"]
DIFF ==============================================
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
`// TODO: Enable and fix leaks; today we have reference cycles between system actors and the system that don't get broken
We weakened the actors holding it only via a
weak
yet should investigate more what could hold it more than necessary.See https://github.com/apple/swift-distributed-actors/pull/565 and https://github.com/apple/swift-distributed-actors/pull/322