opensearch-project / geospatial

Future home of Geospatial features for OpenSearch
Apache License 2.0
33 stars 34 forks source link

Use instance of LockService instantiated in JobScheduler through Guice #677

Open cwperks opened 2 weeks ago

cwperks commented 2 weeks ago

Description

Companion JS PR: https://github.com/opensearch-project/job-scheduler/pull/670

This PR shows how Geospatial can be refactored to use the instance of the LockService that is initialized in Job Scheduler's createComponents.

This PR is part of an effort to remove usages of ThreadContext.stashContext across the plugins: https://github.com/opensearch-project/opensearch-plugins/issues/238

Currently, geospatial instantiates its own instance of the LockService by passing in the Client given to geospatial through createComponents.

As part of the effort to Strengthen System Indices in the Plugin Ecosystem, plugins will be restricted to only perform transport actions to their own system indices. This PR is to ensure that Geospatial uses the LockService instantiated by JS (which has permission to JS system indices) vs creating its own LockService.

Related Issues

Related to https://github.com/opensearch-project/security/issues/4439

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

cwperks commented 2 weeks ago

The CI will fail until companion JS PR is merged