@@ -67,7 +67,10 @@ class DataDomainCache(val ctx: PackageContext<*>) : AssetCache<DataDomain>(ctx,
67
67
if (asset.parentDomain == null ) {
68
68
" "
69
69
} else {
70
- getIdentity(asset.parentDomain.guid)
70
+ // Note: this MUST bypass the read lock, since it is called within a write lock
71
+ // (otherwise, this will become a deadlock -- the read will wait until write lock is released,
72
+ // which will never happen because it is waiting on this read operation to complete.)
73
+ getIdentity(asset.parentDomain.guid, true )
71
74
}
72
75
return if (parentIdentity.isNullOrBlank()) {
73
76
asset.name
@@ -89,11 +92,14 @@ class DataDomainCache(val ctx: PackageContext<*>) : AssetCache<DataDomain>(ctx,
89
92
dataDomain as DataDomain
90
93
cache(dataDomain.guid, getIdentityForAsset(dataDomain), dataDomain)
91
94
}
95
+ // Note: this should NOT be streamed in parallel, as we could otherwise have situations
96
+ // where a parent and child are processed at the same time (in separate threads) and
97
+ // therefore the child becomes unable to resolve its parent's identity.
92
98
DataDomain .select(client)
93
99
.includesOnResults(includesOnResults)
94
100
.where(DataDomain .PARENT_DOMAIN_QUALIFIED_NAME .hasAnyValue())
95
101
.sort(DataDomain .PARENT_DOMAIN_QUALIFIED_NAME .order(SortOrder .Asc ))
96
- .stream(true )
102
+ .stream(false )
97
103
.forEach { dataDomain ->
98
104
dataDomain as DataDomain
99
105
cache(dataDomain.guid, getIdentityForAsset(dataDomain), dataDomain)
0 commit comments