fix(concurrency,durability): address Opus review critical findings
- create_queue: SaveQueue under per-queue lock, not global SyncQueues.Lock (fixes fatal concurrent map iteration/write on idempotent CreateQueue of existing FIFO queue) - delete_message_batch: reject empty ReceiptHandle (JSON protocol bypass deleted all unreceived msgs) - send_message/send_message_batch: register dedupId only after successful persist (retry with same dedupId no longer returns 200 without persisting) - memory_guard: global HeapAlloc guard (SHARED_SQS_MAX_HEAP_MB, 0=off) in send paths
This commit is contained in:
@@ -54,6 +54,12 @@ func DeleteMessageBatchV1(req *http.Request) (int, interfaces.AbstractResponseBo
|
||||
return utils.CreateErrorResponseV1("BatchEntryIdsNotDistinct", true)
|
||||
}
|
||||
ids[v.Id] = true
|
||||
// Пустой ReceiptHandle опасен: в JSON-протоколе (x-amz-json-1.0) он не
|
||||
// отсекается парсером и совпадает с ReceiptHandle НЕвыданных сообщений (""),
|
||||
// что удаляло бы все такие сообщения очереди одним запросом.
|
||||
if v.ReceiptHandle == "" {
|
||||
return utils.CreateErrorResponseV1("InvalidParameterValue", true)
|
||||
}
|
||||
}
|
||||
|
||||
queue := models.SyncQueues.GetLocked(key)
|
||||
|
||||
Reference in New Issue
Block a user