mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
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:
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");
|
||||
|
||||
Reference in new issue
Block a user