-
Notifications
You must be signed in to change notification settings - Fork 54
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 an exception which happens when PutAsync is used more than once and activity logging is enabled in main project #675
Conversation
@@ -603,7 +603,7 @@ public async ValueTask DeleteAsync(string key, CancellationToken cancellationTok | |||
|
|||
private async ValueTask PublishMeta(ObjectMetadata meta, CancellationToken cancellationToken) | |||
{ | |||
var ack = await JetStreamContext.PublishAsync(GetMetaSubject(meta.Name), meta, serializer: NatsObjJsonSerializer<ObjectMetadata>.Default, headers: NatsRollupHeaders, cancellationToken: cancellationToken); | |||
var ack = await JetStreamContext.PublishAsync(GetMetaSubject(meta.Name), meta, serializer: NatsObjJsonSerializer<ObjectMetadata>.Default, headers: _natsRollupHeaders, cancellationToken: cancellationToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we should create the headers here in the local scope. I have a feeling if you call put twice with telemetry turned on you'd still get the same exception even with this fix applied. Could you also write a test showing the issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct. Calling this method twice will result in same exception.
I'll make the changes.
sorry @uhfath could you sign you commits please? you'd need to force push on top and feel free to squash into one commit. |
… and activity logging is enabled in main project Added some tests.
63e51d3
to
be90bf0
Compare
Done. |
nice one. thanks for the extra tests. To run them locally you need a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks @uhfath
* Add OnSocketAvailableAsync Hook (#647) * Refactor exception handling in NatsException (#677) * Fixed an exception which happens when PutAsync is used more than once and activity logging is enabled in main project (#675) * open Header.Writer class and create GetBytesLength method (#674) * Fix date time serialization to use ISO8601 (#664)
* Add OnSocketAvailableAsync Hook (#647) * Refactor exception handling in NatsException (#677) * Fixed an exception which happens when PutAsync is used more than once and activity logging is enabled in main project (#675) * open Header.Writer class and create GetBytesLength method (#674) * Fix date time serialization to use ISO8601 (#664)
Fixes #672