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

#195 Fix buffer overflow exception handling #197

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

2rba
Copy link
Contributor

@2rba 2rba commented Jul 18, 2023

Description

@logger.error(Deimos::KafkaMessage.decoded(messages)) in the rescue block fails to decode the message and causes wrong exception raised
This PR:

  • fixes message decoding
  • adds rescue block around decoding call to make sure if decode is misconfigured that does not interfere with original exception

Fixes #195

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

tests added

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added a line in the CHANGELOG describing this change, under the UNRELEASED heading
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@@ -308,35 +309,6 @@
Deimos.unsubscribe(subscriber)
end

it 'should delete messages on buffer overflow' do
Copy link
Contributor Author

@2rba 2rba Jul 18, 2023

Choose a reason for hiding this comment

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

moved to the context block above

@dorner
Copy link
Member

dorner commented Jul 18, 2023

Thanks so much for the contribution!

@dorner dorner merged commit 6e190c0 into flipp-oss:master Jul 18, 2023
5 checks passed
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.

NoMethodError: undefined method `decoder'
2 participants