opensearch-project / opensearch-project/data-prepper

[BUG] GeoIPProcessor creates new database manager instances on each initialization call

Open
#5,897 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
374
Forks
354
Avg merge
3d 18h
Merged PRs (30d)
8

Description

Describe the bug

  1. When creating a new GeoIPProcessor, the following chain of events occurs:
  2. Constructor requires a GeoIpConfigSupplier (implemented by DefaultGeoIpConfigSupplier)
  3. DefaultGeoIpConfigSupplier.getGeoIPProcessorService() is called
  4. Each call creates a new GeoIPProcessorService(geoIpServiceConfig, geoIPDatabaseManager, readLock)
  5. Each new service instance calls geoIPDatabaseManager.initiateDatabaseDownload()

This results in unnecessary database downloads as the service is instantiated multiple times.

Expected behavior
The databases should not be downloaded on every new GeoIPProcessor call

Environment (please complete the following information):

  1. OS: Linux
  2. Version 2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with DefaultGeoIpConfigSupplier.getGeoIPProcessorService() and trace how GeoIPProcessorService receives geoIPDatabaseManager and invokes initiateDatabaseDownload(). Confirm how often the supplier and service are initialized, then verify that repeated GeoIPProcessor creation no longer triggers unnecessary database downloads.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.