fix(codeartifact): share PyPI retention locks across package spellings (#8201)

* fix(codeartifact): share PyPI retention locks across package spellings

Normalize the per-version retention lock with the existing PEP 503 package-name helper so a background sibling import and a direct wheel request cannot race through different aliases. Add a regression for hyphenated sdist and underscored wheel requests.

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>

* test(codeartifact): observe the shared retention monitor

Await the request thread reaching its shared retention monitor instead of spending a fixed timeout window. Preserve completion and single-write assertions.

Signed-off-by: Andre Kurait <akurait@amazon.com>

---------

Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
Signed-off-by: Andre Kurait <akurait@amazon.com>
This commit is contained in:
Andre Kurait authored and GitHub committed 2026-11-13 07:56:11 -04:00
1 parent 4963472362
commit 5816d8a908
2 files changed
+58 -1

No files matched your search

@@ -294,7 +294,8 @@ public class CodeArtifactPypiExternalConnectionImporter {
importedRequested = importedAny;
return importedRequested;
}
String importLockKey = repoId + "|" + packageName.get() + "|" + version.get();
String importLockKey = repoId + "|" + PypiserverSidecarClient.normalizePackageName(packageName.get())
+ "|" + version.get();
// Splits the version's own files into the one filename actually requested (imported
// synchronously below, so downloadFile's own proxy retry has real bytes to serve the