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

[FIXED] Cleanup reply sub after putting object #1282

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

piotrpio
Copy link
Collaborator

@piotrpio piotrpio commented Jun 1, 2023

Async reply subscription was created on each object.Put() and not cleaned up. This PR closes this subscription after Put() completes.

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
@piotrpio piotrpio requested a review from wallyqs June 1, 2023 12:04
if err != nil {
return nil, err
}

defer jetStream.(*js).cleanupReplySub()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qq, why do we have to type assert here?

Copy link
Collaborator Author

@piotrpio piotrpio Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nc.JetStream() returns an interface, not *js so I could either add cleanupReplySub() as interface method or type assert here - I decided not to clutter the interface with another method (even unexported), but not sure which approach is better.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right... makes sense

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wallyqs
Copy link
Member

wallyqs commented Jun 1, 2023

likely unrelated flapper but might be worth looking at:

=== RUN   TestPullSubscribeFetchBatch/cancel_context_during_fetch
    js_test.go:1423: Expected 5 messages; got: 0
--- FAIL: TestPullSubscribeFetchBatch (0.37s)

@piotrpio
Copy link
Collaborator Author

piotrpio commented Jun 1, 2023

@wallyqs yeah, from what I saw that's a flapper and it's on the list :)

@piotrpio piotrpio merged commit d2c31e4 into main Jun 6, 2023
2 checks passed
@piotrpio piotrpio deleted the object-store-fix-dangling-sub branch June 6, 2023 21:29
@piotrpio piotrpio mentioned this pull request Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants