Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

Commit

Permalink
Downgrade error to warning when retrying because of message too large (
Browse files Browse the repository at this point in the history
  • Loading branch information
tevoinea authored Jun 26, 2023
1 parent db1e489 commit 512bb07
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ApiService/ApiService/onefuzzlib/Queue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,18 @@ public async Task<bool> QueueObject<T>(string name, T obj, StorageType storageTy
try {
return await QueueObjectInternal(obj, queueClient, serializerOptions, visibilityTimeout, timeToLive);
} catch (Exception ex) {
_log.LogError(ex, "Failed to queue message in {QueueName}", name);
if (IsMessageTooLargeException(ex) &&
obj is ITruncatable<T> truncatable) {
_log.LogWarning(ex, "Message too large in {QueueName}", name);

obj = truncatable.Truncate(1000);
try {
return await QueueObjectInternal(obj, queueClient, serializerOptions, visibilityTimeout, timeToLive);
} catch (Exception ex2) {
_log.LogError(ex2, "Failed to queue message in {QueueName} after truncation", name);
}
} else {
_log.LogError(ex, "Failed to queue message in {QueueName}", name);
}
return false;
}
Expand Down

0 comments on commit 512bb07

Please sign in to comment.