Skip to content

Commit 03f0ac3

Browse files
[azservicebus, azeventhubs] Treat 'entity full' as a fatal error (#20722)
When the remote entity is full we get a resource-limit-exceeded condition. This isn't something we should keep retrying on and it's best to just abort and let the user know immediately, rather than hoping it might eventually clear out. This affected both Event Hubs and Service Bus. Fixes #20647
1 parent e2693bd commit 03f0ac3

File tree

6 files changed

+81
-62
lines changed

6 files changed

+81
-62
lines changed

sdk/messaging/azeventhubs/CHANGELOG.md

+13-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Release History
22

3-
## 1.0.0 (2023-04-11)
3+
## 1.0.0 (2023-05-09)
44

55
### Features Added
66

@@ -13,13 +13,14 @@
1313
- Recovery now includes internal timeouts and also handles restarting a connection if AMQP primitives aren't closed cleanly.
1414
- Potential leaks for $cbs and $management when there was a partial failure. (PR#20564)
1515
- Latest go-amqp changes have been merged in with fixes for robustness.
16+
- Sending a message to an entity that is full will no longer retry. (PR#20722)
1617

1718
## 0.6.0 (2023-03-07)
1819

1920
### Features Added
2021

21-
- Added the `ConsumerClientOptions.InstanceID` field. This optional field can enhance error messages from
22-
Event Hubs. For example, error messages related to ownership changes for a partition will contain the
22+
- Added the `ConsumerClientOptions.InstanceID` field. This optional field can enhance error messages from
23+
Event Hubs. For example, error messages related to ownership changes for a partition will contain the
2324
name of the link that has taken ownership, which can help with traceability.
2425

2526
### Breaking Changes
@@ -41,15 +42,15 @@
4142
### Breaking Changes
4243

4344
- ProcessorOptions.OwnerLevel has been removed. The Processor uses 0 as the owner level.
44-
- Uses the public release of `github.com/Azure/azure-sdk-for-go/sdk/storage/azblob` package rather than using an internal copy.
45+
- Uses the public release of `github.com/Azure/azure-sdk-for-go/sdk/storage/azblob` package rather than using an internal copy.
4546
For an example, see [example_consuming_with_checkpoints_test.go](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/messaging/azeventhubs/example_consuming_with_checkpoints_test.go).
4647

4748
## 0.4.0 (2023-01-10)
4849

4950
### Bugs Fixed
5051

5152
- User-Agent was incorrectly formatted in our AMQP-based clients. (PR#19712)
52-
- Connection recovery has been improved, removing some unnecessasry retries as well as adding a bound around
53+
- Connection recovery has been improved, removing some unnecessasry retries as well as adding a bound around
5354
some operations (Close) that could potentially block recovery for a long time. (PR#19683)
5455

5556
## 0.3.0 (2022-11-10)
@@ -78,7 +79,7 @@
7879
- NewWebSocketConnArgs renamed to WebSocketConnParams
7980
- Code renamed to ErrorCode, including associated constants like `ErrorCodeOwnershipLost`.
8081
- OwnershipData, CheckpointData, and CheckpointStoreAddress have been folded into their individual structs: Ownership and Checkpoint.
81-
- StartPosition and OwnerLevel were erroneously included in the ConsumerClientOptions struct - they've been removed. These can be
82+
- StartPosition and OwnerLevel were erroneously included in the ConsumerClientOptions struct - they've been removed. These can be
8283
configured in the PartitionClientOptions.
8384

8485
### Bugs Fixed
@@ -90,8 +91,8 @@
9091

9192
### Features Added
9293

93-
- Adding in the new Processor type, which can be used to do distributed (and load balanced) consumption of events, using a
94-
CheckpointStore. The built-in checkpoints.BlobStore uses Azure Blob Storage for persistence. A full example is
94+
- Adding in the new Processor type, which can be used to do distributed (and load balanced) consumption of events, using a
95+
CheckpointStore. The built-in checkpoints.BlobStore uses Azure Blob Storage for persistence. A full example is
9596
in [example_consuming_with_checkpoints_test.go](https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/messaging/azeventhubs/example_consuming_with_checkpoints_test.go).
9697

9798
### Breaking Changes
@@ -101,15 +102,16 @@
101102
instances (using ConsumerClient.NewPartitionClient), which allows you to share the same AMQP connection and receive from multiple
102103
partitions simultaneously.
103104
- Changes to EventData/ReceivedEventData:
105+
104106
- ReceivedEventData now embeds EventData for fields common between the two, making it easier to change and resend.
105107
- `ApplicationProperties` renamed to `Properties`.
106108
- `PartitionKey` removed from `EventData`. To send events using a PartitionKey you must set it in the options
107109
when creating the EventDataBatch:
108110

109111
```go
110112
batch, err := producerClient.NewEventDataBatch(context.TODO(), &azeventhubs.NewEventDataBatchOptions{
111-
PartitionKey: to.Ptr("partition key"),
112-
})
113+
PartitionKey: to.Ptr("partition key"),
114+
})
113115
```
114116

115117
### Bugs Fixed
@@ -120,4 +122,4 @@
120122

121123
## 0.1.0 (2022-08-11)
122124

123-
- Initial preview for the new version of the Azure Event Hubs Go SDK.
125+
- Initial preview for the new version of the Azure Event Hubs Go SDK.

sdk/messaging/azeventhubs/internal/errors.go

+3
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ var amqpConditionsToRecoveryKind = map[amqp.ErrCond]RecoveryKind{
139139
amqp.ErrCondInternalError: RecoveryKindConn, // "amqp:internal-error"
140140

141141
// No recovery possible - this operation is non retriable.
142+
143+
// ErrCondResourceLimitExceeded comes back if the entity is actually full.
144+
amqp.ErrCondResourceLimitExceeded: RecoveryKindFatal, // "amqp:resource-limit-exceeded"
142145
amqp.ErrCondMessageSizeExceeded: RecoveryKindFatal, // "amqp:link:message-size-exceeded"
143146
amqp.ErrCondUnauthorizedAccess: RecoveryKindFatal, // creds are bad
144147
amqp.ErrCondNotFound: RecoveryKindFatal, // "amqp:not-found"

sdk/messaging/azeventhubs/internal/errors_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ func TestGetRecoveryKind(t *testing.T) {
4444
require.Equal(t, GetRecoveryKind(context.Canceled), RecoveryKindFatal)
4545
require.Equal(t, GetRecoveryKind(RPCError{Resp: &amqpwrap.RPCResponse{Code: http.StatusUnauthorized}}), RecoveryKindFatal)
4646
require.Equal(t, GetRecoveryKind(RPCError{Resp: &amqpwrap.RPCResponse{Code: http.StatusNotFound}}), RecoveryKindFatal)
47+
require.Equal(t, GetRecoveryKind(&amqp.Error{Condition: amqp.ErrCondResourceLimitExceeded}), RecoveryKindFatal)
4748
}
4849

4950
func Test_TransformError(t *testing.T) {

0 commit comments

Comments
 (0)