Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[azservicebus] Fixing memory leak with go-amqp update. #22253

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sdk/messaging/azservicebus/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

- ReceiverOptions.TimeAfterFirstMessage lets you configure the amount of time, after the first message in a batch is received, before we return messages. (PR#22154)

### Bugs Fixed

- Settling a message (using CompleteMessage, AbandonMessage, etc..) on a different Receiver instance than you received on no
longer leaks memory. (PR#TBD)

## 1.5.0 (2023-10-10)

### Features Added
Expand Down
2 changes: 1 addition & 1 deletion sdk/messaging/azservicebus/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0
github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0
github.com/Azure/go-amqp v1.0.2
github.com/Azure/go-amqp v1.0.4
)

require (
Expand Down
4 changes: 2 additions & 2 deletions sdk/messaging/azservicebus/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdE
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0 h1:TuEMD+E+1aTjjLICGQOW6vLe8UWES7kopac9mUXL56Y=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.4.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI=
github.com/Azure/go-amqp v1.0.2 h1:zHCHId+kKC7fO8IkwyZJnWMvtRXhYC0VJtD0GYkHc6M=
github.com/Azure/go-amqp v1.0.2/go.mod h1:vZAogwdrkbyK3Mla8m/CxSc/aKdnTZ4IbPxl51Y5WZE=
github.com/Azure/go-amqp v1.0.4 h1:GX5OFOs706UjuFRD5PDKm3aOuLQ92F7DMbua+DKAYCc=
github.com/Azure/go-amqp v1.0.4/go.mod h1:vZAogwdrkbyK3Mla8m/CxSc/aKdnTZ4IbPxl51Y5WZE=
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c=
github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
32 changes: 32 additions & 0 deletions sdk/messaging/azservicebus/receiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,38 @@ import (
"github.com/stretchr/testify/require"
)

func TestReceiverBackupSettlement(t *testing.T) {
serviceBusClient, cleanup, queueName := setupLiveTest(t, &liveTestOptions{
QueueProperties: &admin.QueueProperties{
LockDuration: to.Ptr("PT5M"),
},
})
defer cleanup()

sender, err := serviceBusClient.NewSender(queueName, nil)
require.NoError(t, err)

err = sender.SendMessage(context.Background(), &Message{
Body: []byte("hello world"),
}, nil)
require.NoError(t, err)

origReceiver, err := serviceBusClient.NewReceiverForQueue(queueName, nil)
require.NoError(t, err)
defer test.RequireClose(t, origReceiver)

otherReceiver, err := serviceBusClient.NewReceiverForQueue(queueName, nil)
require.NoError(t, err)
defer test.RequireClose(t, otherReceiver)

messages, err := origReceiver.ReceiveMessages(context.TODO(), 1, nil)
require.NoError(t, err)
require.NotEmpty(t, messages)

err = otherReceiver.CompleteMessage(context.Background(), messages[0], nil)
require.NoError(t, err)
}

func TestReceiverCancel(t *testing.T) {
serviceBusClient, cleanup, queueName := setupLiveTest(t, nil)
defer cleanup()
Expand Down
Loading