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

Add missing exception handling for IpInfo*Resolver #19750

Merged
merged 2 commits into from
Jun 26, 2024
Merged

Conversation

patrickmann
Copy link
Contributor

@patrickmann patrickmann commented Jun 26, 2024

Resolves Graylog2/graylog-plugin-enterprise#7602

IpInfo*Resolver classes only handle a specific set of exception types. Unknown exceptions bubble up, leading to processing failure.
Extend exception handling to cover all types of exceptions.

Description

When an IP address cannot be resolved against the IPInfo DB, we may receive a com.maxmind.db.DeserializationException from IPinfoIPLocationDatabaseAdapter.
This may occur in 2 places:

  • MaxmindDataAdapter: this class handles any exceptions in lookup.
  • IpInfoIpAsnResolver and IpInfoLocationResolver: these classes only handle a subset of exception types, resulting in an unexpected exception and failure to process messages when an unknown exception is encountered.

Motivation and Context

This affects all versions that support IPInfo DBs, i.e. 5.1 and up.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@patrickmann patrickmann marked this pull request as ready for review June 26, 2024 13:47
Copy link
Contributor

@AntonEbel AntonEbel left a comment

Choose a reason for hiding this comment

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

LGTM

@AntonEbel AntonEbel merged commit 8c5c9ac into master Jun 26, 2024
9 checks passed
@AntonEbel AntonEbel deleted the ipinfoException branch June 26, 2024 15:28
patrickmann added a commit that referenced this pull request Jun 26, 2024
* add missing exception handling for IpInfo*Resolver

* CL

(cherry picked from commit 8c5c9ac)
AntonEbel pushed a commit that referenced this pull request Jun 26, 2024
* Add missing exception handling for IpInfo*Resolver (#19750)

* add missing exception handling for IpInfo*Resolver

* CL

(cherry picked from commit 8c5c9ac)

* update CL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants