opensearch-project / opensearch-project/data-prepper
[BUG] GeoIPProcessor creates new database manager instances on each initialization call
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 374
- Forks
- 354
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 8
Description
Describe the bug
- When creating a new GeoIPProcessor, the following chain of events occurs:
- Constructor requires a GeoIpConfigSupplier (implemented by DefaultGeoIpConfigSupplier)
- DefaultGeoIpConfigSupplier.getGeoIPProcessorService() is called
- Each call creates a new GeoIPProcessorService(geoIpServiceConfig, geoIPDatabaseManager, readLock)
- 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):
- OS: Linux
- Version 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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