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

GH-3686: Fix observation scope closure in the KafkaMLContainer #3689

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

artembilan
Copy link
Member

@artembilan artembilan commented Dec 17, 2024

Fixes: #3686

According to our investigation around the try-with-resource, it looks like the resource is already closed when we reach the catch block.

  • Rework KafkaMessageListenerContainer.ListenerConsumer.doInvokeRecordListener() to observation.openScope() before the try and close it manually in the finally block

@artembilan artembilan changed the title GH-3686: Fix observation scope closure in the `KafkaMessageListenerCo… GH-3686: Fix observation scope closure in the KafkaMLContainer Dec 17, 2024
…Container`

Fixes: spring-projects#3686

According to our investigation around the `try-with-resource`,
it looks like the resource is already closed when we reach the `catch` block.

* Rework  `KafkaMessageListenerContainer.ListenerConsumer.doInvokeRecordListener()`
to `observation.openScope()` before the `try` and close it manually in the `finally` block
* Verify `RecordInterceptor.failure()` has a scope in the `ObservationTests`
@sobychacko sobychacko merged commit 6e03b47 into spring-projects:main Dec 17, 2024
3 checks passed
@artembilan artembilan deleted the GH-3686 branch December 19, 2024 15:33
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.

KafkaMessageListenerContainer Observation Scope seems to be setup incorrectly
2 participants