Skip to content

Commit 777f702

Browse files
authored
Merge pull request #2324 from atlanhq/dependencies
fix(ci+cache): decouple package tests from integration jobs; prevent CM cache refresh storms
2 parents 8178a90 + 77c1274 commit 777f702

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,6 @@ jobs:
119119
needs:
120120
- build
121121
- list-packages
122-
- integration-test
123-
if: ${{ always() && needs.build.result == 'success' }}
124122
runs-on: ubuntu-latest
125123
strategy:
126124
fail-fast: false
@@ -161,8 +159,6 @@ jobs:
161159
needs:
162160
- build
163161
- list-packages
164-
- integration-test
165-
if: ${{ always() && needs.build.result == 'success' }}
166162
runs-on: ubuntu-latest
167163
strategy:
168164
fail-fast: false

samples/packages/adoption-export/src/test/kotlin/ExportUniqueUserViewsTest.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import org.testng.Assert.assertFalse
88
import org.testng.Assert.assertTrue
99
import org.testng.annotations.Test
1010
import java.io.File
11-
import java.math.BigDecimal
1211

1312
/**
1413
* Test export of asset views adoption information, sorted by number of unique users.

sdk/src/main/java/com/atlan/cache/CustomMetadataCache.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class CustomMetadataCache extends AbstractMassTrackingCache<CustomMetadat
3232
private volatile Map<String, Map<String, String>> mapAttrSidToName = new ConcurrentHashMap<>();
3333
private volatile Map<String, Map<String, String>> mapAttrNameToSid = new ConcurrentHashMap<>();
3434
private volatile Set<String> archivedAttrSids = ConcurrentHashMap.newKeySet();
35+
private volatile Set<String> deletedAttrIds = ConcurrentHashMap.newKeySet();
3536

3637
private final TypeDefsEndpoint typeDefsEndpoint;
3738

@@ -69,6 +70,7 @@ protected void refreshCache() throws AtlanException {
6970
mapAttrSidToName.clear();
7071
mapAttrNameToSid.clear();
7172
archivedAttrSids.clear();
73+
deletedAttrIds.clear();
7274
super.refreshCache();
7375
for (CustomMetadataDef bmDef : customMetadata) {
7476
String typeId = bmDef.getName();
@@ -529,6 +531,10 @@ private String getAttrNameForIdFromSetId(String setId, String attributeId, long
529531
if (setId == null || setId.isEmpty()) throw new InvalidRequestException(ErrorCode.MISSING_CM_ID);
530532
if (attributeId == null || attributeId.isEmpty())
531533
throw new InvalidRequestException(ErrorCode.MISSING_CM_ATTR_ID);
534+
String compositeKey = setId + "." + attributeId;
535+
if (deletedAttrIds.contains(compositeKey)) {
536+
throw new NotFoundException(ErrorCode.CM_ATTR_NOT_FOUND_BY_ID, attributeId, setId);
537+
}
532538
Map<String, String> subMap = getAttrNameFromId(setId);
533539
String attrName = null;
534540
if (subMap != null) {
@@ -539,13 +545,15 @@ private String getAttrNameForIdFromSetId(String setId, String attributeId, long
539545
refresh(minimumTime);
540546
subMap = getAttrNameFromId(setId);
541547
if (subMap == null) {
548+
deletedAttrIds.add(compositeKey);
542549
throw new NotFoundException(ErrorCode.CM_NO_ATTRIBUTES, setId);
543550
}
544551
} else {
545552
return attrName;
546553
}
547554
attrName = subMap.get(attributeId);
548555
if (attrName == null) {
556+
deletedAttrIds.add(compositeKey);
549557
throw new NotFoundException(ErrorCode.CM_ATTR_NOT_FOUND_BY_ID, attributeId, setId);
550558
}
551559
return attrName;

0 commit comments

Comments
 (0)