fix(bedrock): serialize guardrail name creation (#8484)

CreateGuardrail now runs under the service lock every other guardrail
writer already holds, so its name check and write can no longer overlap
another create: of two concurrent creates with the same name, the second
gets ConflictException instead of storing a second guardrail.

The new concurrency test and BedrockGuardrailLifecycleConcurrencyTest
stage their races through ParkingStoreAssertions instead of their own
threads and waits.

Closes #8483
This commit is contained in:
galsuchetzky-act authored and GitHub committed 2026-11-15 15:14:48 -04:00
1 parent fdbcbb68ec
commit db36808d38
3 files changed
+73 -41

No files matched your search

@@ -154,7 +154,7 @@ public class BedrockService implements ResourceProvider {
this.kmsService = kmsService;
}
public Guardrail createGuardrail(JsonNode request, String region) {
public synchronized Guardrail createGuardrail(JsonNode request, String region) {
String name = requiredName(request);
String description = boundedDescription(request);
String blockedInputMessaging = requiredBlockedMessaging(request, "blockedInputMessaging");